diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6bc8997cfde..05ce562f5e2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5270,6 +5270,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. @@ -8942,6 +9015,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: @@ -8958,6 +9040,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: @@ -12602,6 +12731,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: @@ -12873,6 +13064,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: @@ -16862,6 +17136,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: @@ -20712,6 +21015,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 @@ -20753,6 +21203,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. @@ -20878,6 +21364,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: @@ -28295,6 +28789,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: @@ -74543,10 +75046,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/).' @@ -78230,6 +78739,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. diff --git a/examples/v2/security-monitoring/AttachCase.java b/examples/v2/security-monitoring/AttachCase.java new file mode 100644 index 00000000000..1e9cf00c696 --- /dev/null +++ b/examples/v2/security-monitoring/AttachCase.java @@ -0,0 +1,54 @@ +// Attach security findings to a case returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.AttachCaseRequest; +import com.datadog.api.client.v2.model.AttachCaseRequestData; +import com.datadog.api.client.v2.model.AttachCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.CaseDataType; +import com.datadog.api.client.v2.model.FindingCaseResponse; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import java.util.Arrays; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + AttachCaseRequest body = + new AttachCaseRequest() + .data( + new AttachCaseRequestData() + .id("7d16945b-baf8-411e-ab2a-20fe43af1ea3") + .relationships( + new AttachCaseRequestDataRelationships() + .findings( + new Findings() + .data( + Arrays.asList( + new FindingData() + .id( + "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=") + .type(FindingDataType.FINDINGS), + new FindingData() + .id( + "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=") + .type(FindingDataType.FINDINGS))))) + .type(CaseDataType.CASES)); + + try { + FindingCaseResponse result = + apiInstance.attachCase("7d16945b-baf8-411e-ab2a-20fe43af1ea3", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#attachCase"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/AttachCase_897782765.java b/examples/v2/security-monitoring/AttachCase_897782765.java new file mode 100644 index 00000000000..a21b965fffb --- /dev/null +++ b/examples/v2/security-monitoring/AttachCase_897782765.java @@ -0,0 +1,50 @@ +// Attach security finding to a case returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.AttachCaseRequest; +import com.datadog.api.client.v2.model.AttachCaseRequestData; +import com.datadog.api.client.v2.model.AttachCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.CaseDataType; +import com.datadog.api.client.v2.model.FindingCaseResponse; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + AttachCaseRequest body = + new AttachCaseRequest() + .data( + new AttachCaseRequestData() + .id("7d16945b-baf8-411e-ab2a-20fe43af1ea3") + .relationships( + new AttachCaseRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id( + "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=") + .type(FindingDataType.FINDINGS))))) + .type(CaseDataType.CASES)); + + try { + FindingCaseResponse result = + apiInstance.attachCase("7d16945b-baf8-411e-ab2a-20fe43af1ea3", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#attachCase"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/AttachJiraIssue.java b/examples/v2/security-monitoring/AttachJiraIssue.java new file mode 100644 index 00000000000..c49d9e41330 --- /dev/null +++ b/examples/v2/security-monitoring/AttachJiraIssue.java @@ -0,0 +1,66 @@ +// Attach security findings to a Jira issue returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.AttachJiraIssueRequest; +import com.datadog.api.client.v2.model.AttachJiraIssueRequestData; +import com.datadog.api.client.v2.model.AttachJiraIssueRequestDataAttributes; +import com.datadog.api.client.v2.model.AttachJiraIssueRequestDataRelationships; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.FindingCaseResponse; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import com.datadog.api.client.v2.model.JiraIssuesDataType; +import java.util.Arrays; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + AttachJiraIssueRequest body = + new AttachJiraIssueRequest() + .data( + new AttachJiraIssueRequestData() + .attributes( + new AttachJiraIssueRequestDataAttributes() + .jiraIssueUrl( + "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476")) + .relationships( + new AttachJiraIssueRequestDataRelationships() + .findings( + new Findings() + .data( + Arrays.asList( + new FindingData() + .id( + "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=") + .type(FindingDataType.FINDINGS), + new FindingData() + .id( + "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("959a6f71-bac8-4027-b1d3-2264f569296f") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(JiraIssuesDataType.JIRA_ISSUES)); + + try { + FindingCaseResponse result = apiInstance.attachJiraIssue(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#attachJiraIssue"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/AttachJiraIssue_3042842144.java b/examples/v2/security-monitoring/AttachJiraIssue_3042842144.java new file mode 100644 index 00000000000..318ec992ad4 --- /dev/null +++ b/examples/v2/security-monitoring/AttachJiraIssue_3042842144.java @@ -0,0 +1,62 @@ +// Attach security finding to a Jira issue returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.AttachJiraIssueRequest; +import com.datadog.api.client.v2.model.AttachJiraIssueRequestData; +import com.datadog.api.client.v2.model.AttachJiraIssueRequestDataAttributes; +import com.datadog.api.client.v2.model.AttachJiraIssueRequestDataRelationships; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.FindingCaseResponse; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import com.datadog.api.client.v2.model.JiraIssuesDataType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + AttachJiraIssueRequest body = + new AttachJiraIssueRequest() + .data( + new AttachJiraIssueRequestData() + .attributes( + new AttachJiraIssueRequestDataAttributes() + .jiraIssueUrl( + "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476")) + .relationships( + new AttachJiraIssueRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id( + "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("959a6f71-bac8-4027-b1d3-2264f569296f") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(JiraIssuesDataType.JIRA_ISSUES)); + + try { + FindingCaseResponse result = apiInstance.attachJiraIssue(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#attachJiraIssue"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/CreateCases.java b/examples/v2/security-monitoring/CreateCases.java new file mode 100644 index 00000000000..1d85e2724d9 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases.java @@ -0,0 +1,86 @@ +// Create cases for security findings returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseDataType; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.CreateCaseRequestArray; +import com.datadog.api.client.v2.model.CreateCaseRequestData; +import com.datadog.api.client.v2.model.CreateCaseRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateCaseRequestArray body = + new CreateCaseRequestArray() + .data( + Arrays.asList( + new CreateCaseRequestData() + .attributes( + new CreateCaseRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateCaseRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id( + "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("959a6f71-bac8-4027-b1d3-2264f569296f") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(CaseDataType.CASES), + new CreateCaseRequestData() + .attributes( + new CreateCaseRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateCaseRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id( + "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("959a6f71-bac8-4027-b1d3-2264f569296f") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(CaseDataType.CASES))); + + try { + FindingCaseResponseArray result = apiInstance.createCases(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createCases"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/CreateCases_2385516013.java b/examples/v2/security-monitoring/CreateCases_2385516013.java new file mode 100644 index 00000000000..bbca5c082f6 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases_2385516013.java @@ -0,0 +1,63 @@ +// Create case for security finding returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseDataType; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.CreateCaseRequestArray; +import com.datadog.api.client.v2.model.CreateCaseRequestData; +import com.datadog.api.client.v2.model.CreateCaseRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateCaseRequestArray body = + new CreateCaseRequestArray() + .data( + Collections.singletonList( + new CreateCaseRequestData() + .attributes( + new CreateCaseRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateCaseRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id( + "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("959a6f71-bac8-4027-b1d3-2264f569296f") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(CaseDataType.CASES))); + + try { + FindingCaseResponseArray result = apiInstance.createCases(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createCases"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/CreateCases_2798851680.java b/examples/v2/security-monitoring/CreateCases_2798851680.java new file mode 100644 index 00000000000..3c06a697e59 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases_2798851680.java @@ -0,0 +1,68 @@ +// Create case for security findings returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseDataType; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.CreateCaseRequestArray; +import com.datadog.api.client.v2.model.CreateCaseRequestData; +import com.datadog.api.client.v2.model.CreateCaseRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateCaseRequestArray body = + new CreateCaseRequestArray() + .data( + Collections.singletonList( + new CreateCaseRequestData() + .attributes( + new CreateCaseRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateCaseRequestDataRelationships() + .findings( + new Findings() + .data( + Arrays.asList( + new FindingData() + .id( + "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=") + .type(FindingDataType.FINDINGS), + new FindingData() + .id( + "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=") + .type(FindingDataType.FINDINGS)))) + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .id("959a6f71-bac8-4027-b1d3-2264f569296f") + .type(CaseManagementProjectDataType.PROJECTS)))) + .type(CaseDataType.CASES))); + + try { + FindingCaseResponseArray result = apiInstance.createCases(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createCases"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/CreateJiraIssues.java b/examples/v2/security-monitoring/CreateJiraIssues.java new file mode 100644 index 00000000000..53dbdd74cb2 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues.java @@ -0,0 +1,135 @@ +// Create Jira issues for security findings returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseDataType; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.CreateCaseRequestData; +import com.datadog.api.client.v2.model.CreateCaseRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestArrayIncluded; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestData; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationships; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCase; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCaseData; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import com.datadog.api.client.v2.model.JiraIssuesDataType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateJiraIssueRequestArray body = + new CreateJiraIssueRequestArray() + .data( + Arrays.asList( + new CreateJiraIssueRequestData() + .type(JiraIssuesDataType.JIRA_ISSUES) + .attributes(new CreateJiraIssueRequestDataAttributes()) + .relationships( + new CreateJiraIssueRequestDataRelationships() + ._case( + new CreateJiraIssueRequestDataRelationshipsCase() + .data( + new CreateJiraIssueRequestDataRelationshipsCaseData() + .type(CaseDataType.CASES) + .id("53e242c6-a7d6-46ad-9680-b8d14753f716")))), + new CreateJiraIssueRequestData() + .type(JiraIssuesDataType.JIRA_ISSUES) + .attributes(new CreateJiraIssueRequestDataAttributes()) + .relationships( + new CreateJiraIssueRequestDataRelationships() + ._case( + new CreateJiraIssueRequestDataRelationshipsCase() + .data( + new CreateJiraIssueRequestDataRelationshipsCaseData() + .type(CaseDataType.CASES) + .id("195772b2-1f53-41d2-b81e-48c8e6c21d33")))))) + .included( + Arrays.asList( + new CreateJiraIssueRequestArrayIncluded( + new CreateCaseRequestData() + .type(CaseDataType.CASES) + .attributes( + new CreateCaseRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateCaseRequestDataRelationships() + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .type(CaseManagementProjectDataType.PROJECTS) + .id("959a6f71-bac8-4027-b1d3-2264f569296f"))) + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="))))) + .id("53e242c6-a7d6-46ad-9680-b8d14753f716")), + new CreateJiraIssueRequestArrayIncluded( + new CreateCaseRequestData() + .type(CaseDataType.CASES) + .attributes( + new CreateCaseRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateCaseRequestDataRelationships() + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .type(CaseManagementProjectDataType.PROJECTS) + .id("959a6f71-bac8-4027-b1d3-2264f569296f"))) + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="))))) + .id("195772b2-1f53-41d2-b81e-48c8e6c21d33")), + new CreateJiraIssueRequestArrayIncluded( + new CaseManagementProjectData() + .type(CaseManagementProjectDataType.PROJECTS) + .id("959a6f71-bac8-4027-b1d3-2264f569296f")), + new CreateJiraIssueRequestArrayIncluded( + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=")), + new CreateJiraIssueRequestArrayIncluded( + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=")))); + + try { + FindingCaseResponseArray result = apiInstance.createJiraIssues(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createJiraIssues"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/CreateJiraIssues_379590688.java b/examples/v2/security-monitoring/CreateJiraIssues_379590688.java new file mode 100644 index 00000000000..df6b9e51ef6 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_379590688.java @@ -0,0 +1,95 @@ +// Create Jira issue for security finding returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseDataType; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.CreateCaseRequestData; +import com.datadog.api.client.v2.model.CreateCaseRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestArrayIncluded; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestData; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationships; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCase; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCaseData; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import com.datadog.api.client.v2.model.JiraIssuesDataType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateJiraIssueRequestArray body = + new CreateJiraIssueRequestArray() + .data( + Collections.singletonList( + new CreateJiraIssueRequestData() + .type(JiraIssuesDataType.JIRA_ISSUES) + .attributes(new CreateJiraIssueRequestDataAttributes()) + .relationships( + new CreateJiraIssueRequestDataRelationships() + ._case( + new CreateJiraIssueRequestDataRelationshipsCase() + .data( + new CreateJiraIssueRequestDataRelationshipsCaseData() + .type(CaseDataType.CASES) + .id("6a773295-8729-4034-aada-53b64cbe02e7")))))) + .included( + Arrays.asList( + new CreateJiraIssueRequestArrayIncluded( + new CreateCaseRequestData() + .type(CaseDataType.CASES) + .attributes( + new CreateCaseRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateCaseRequestDataRelationships() + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .type(CaseManagementProjectDataType.PROJECTS) + .id("959a6f71-bac8-4027-b1d3-2264f569296f"))) + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="))))) + .id("6a773295-8729-4034-aada-53b64cbe02e7")), + new CreateJiraIssueRequestArrayIncluded( + new CaseManagementProjectData() + .type(CaseManagementProjectDataType.PROJECTS) + .id("959a6f71-bac8-4027-b1d3-2264f569296f")), + new CreateJiraIssueRequestArrayIncluded( + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=")))); + + try { + FindingCaseResponseArray result = apiInstance.createJiraIssues(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createJiraIssues"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/CreateJiraIssues_829823123.java b/examples/v2/security-monitoring/CreateJiraIssues_829823123.java new file mode 100644 index 00000000000..ffa4b5f52cc --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_829823123.java @@ -0,0 +1,104 @@ +// Create Jira issue for security findings returns "Created" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseDataType; +import com.datadog.api.client.v2.model.CaseManagementProject; +import com.datadog.api.client.v2.model.CaseManagementProjectData; +import com.datadog.api.client.v2.model.CaseManagementProjectDataType; +import com.datadog.api.client.v2.model.CreateCaseRequestData; +import com.datadog.api.client.v2.model.CreateCaseRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestArrayIncluded; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestData; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataAttributes; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationships; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCase; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestDataRelationshipsCaseData; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import com.datadog.api.client.v2.model.JiraIssuesDataType; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateJiraIssueRequestArray body = + new CreateJiraIssueRequestArray() + .data( + Collections.singletonList( + new CreateJiraIssueRequestData() + .type(JiraIssuesDataType.JIRA_ISSUES) + .attributes(new CreateJiraIssueRequestDataAttributes()) + .relationships( + new CreateJiraIssueRequestDataRelationships() + ._case( + new CreateJiraIssueRequestDataRelationshipsCase() + .data( + new CreateJiraIssueRequestDataRelationshipsCaseData() + .type(CaseDataType.CASES) + .id("e469ceda-957a-4557-a607-9ff25032e9ca")))))) + .included( + Arrays.asList( + new CreateJiraIssueRequestArrayIncluded( + new CreateCaseRequestData() + .type(CaseDataType.CASES) + .attributes( + new CreateCaseRequestDataAttributes() + .title("A title") + .description("A description")) + .relationships( + new CreateCaseRequestDataRelationships() + .project( + new CaseManagementProject() + .data( + new CaseManagementProjectData() + .type(CaseManagementProjectDataType.PROJECTS) + .id("959a6f71-bac8-4027-b1d3-2264f569296f"))) + .findings( + new Findings() + .data( + Arrays.asList( + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="), + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="))))) + .id("e469ceda-957a-4557-a607-9ff25032e9ca")), + new CreateJiraIssueRequestArrayIncluded( + new CaseManagementProjectData() + .type(CaseManagementProjectDataType.PROJECTS) + .id("959a6f71-bac8-4027-b1d3-2264f569296f")), + new CreateJiraIssueRequestArrayIncluded( + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=")), + new CreateJiraIssueRequestArrayIncluded( + new FindingData() + .type(FindingDataType.FINDINGS) + .id( + "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=")))); + + try { + FindingCaseResponseArray result = apiInstance.createJiraIssues(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createJiraIssues"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/DetachCase.java b/examples/v2/security-monitoring/DetachCase.java new file mode 100644 index 00000000000..a1ea2afa5c8 --- /dev/null +++ b/examples/v2/security-monitoring/DetachCase.java @@ -0,0 +1,46 @@ +// Detach security findings from their case returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.CaseDataType; +import com.datadog.api.client.v2.model.DetachCaseRequest; +import com.datadog.api.client.v2.model.DetachCaseRequestData; +import com.datadog.api.client.v2.model.DetachCaseRequestDataRelationships; +import com.datadog.api.client.v2.model.FindingData; +import com.datadog.api.client.v2.model.FindingDataType; +import com.datadog.api.client.v2.model.Findings; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + DetachCaseRequest body = + new DetachCaseRequest() + .data( + new DetachCaseRequestData() + .relationships( + new DetachCaseRequestDataRelationships() + .findings( + new Findings() + .data( + Collections.singletonList( + new FindingData() + .id( + "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=") + .type(FindingDataType.FINDINGS))))) + .type(CaseDataType.CASES)); + + try { + apiInstance.detachCase(body); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#detachCase"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index a6b569264c1..50115900a58 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -6,15 +6,22 @@ import com.datadog.api.client.PaginationIterable; import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.AssetType; +import com.datadog.api.client.v2.model.AttachCaseRequest; +import com.datadog.api.client.v2.model.AttachJiraIssueRequest; import com.datadog.api.client.v2.model.BulkMuteFindingsRequest; import com.datadog.api.client.v2.model.BulkMuteFindingsResponse; import com.datadog.api.client.v2.model.CloudAssetType; import com.datadog.api.client.v2.model.ConvertJobResultsToSignalsRequest; +import com.datadog.api.client.v2.model.CreateCaseRequestArray; import com.datadog.api.client.v2.model.CreateCustomFrameworkRequest; import com.datadog.api.client.v2.model.CreateCustomFrameworkResponse; +import com.datadog.api.client.v2.model.CreateJiraIssueRequestArray; import com.datadog.api.client.v2.model.CreateNotificationRuleParameters; import com.datadog.api.client.v2.model.DeleteCustomFrameworkResponse; +import com.datadog.api.client.v2.model.DetachCaseRequest; import com.datadog.api.client.v2.model.Finding; +import com.datadog.api.client.v2.model.FindingCaseResponse; +import com.datadog.api.client.v2.model.FindingCaseResponseArray; import com.datadog.api.client.v2.model.FindingEvaluation; import com.datadog.api.client.v2.model.FindingStatus; import com.datadog.api.client.v2.model.FindingVulnerabilityType; @@ -116,6 +123,295 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** + * Attach security findings to a case. + * + *

See {@link #attachCaseWithHttpInfo}. + * + * @param caseId The unique identifier of the case to attach security findings to (required) + * @param body (required) + * @return FindingCaseResponse + * @throws ApiException if fails to make API call + */ + public FindingCaseResponse attachCase(String caseId, AttachCaseRequest body) throws ApiException { + return attachCaseWithHttpInfo(caseId, body).getData(); + } + + /** + * Attach security findings to a case. + * + *

See {@link #attachCaseWithHttpInfoAsync}. + * + * @param caseId The unique identifier of the case to attach security findings to (required) + * @param body (required) + * @return CompletableFuture<FindingCaseResponse> + */ + public CompletableFuture attachCaseAsync( + String caseId, AttachCaseRequest body) { + return attachCaseWithHttpInfoAsync(caseId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 caseId The unique identifier of the case to attach security findings to (required) + * @param body (required) + * @return ApiResponse<FindingCaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse attachCaseWithHttpInfo( + String caseId, AttachCaseRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + throw new ApiException( + 400, "Missing the required parameter 'caseId' when calling attachCase"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling attachCase"); + } + // create path and map variables + String localVarPath = + "/api/v2/security/findings/cases/{case_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.attachCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Attach security findings to a case. + * + *

See {@link #attachCaseWithHttpInfo}. + * + * @param caseId The unique identifier of the case to attach security findings to (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<FindingCaseResponse>> + */ + public CompletableFuture> attachCaseWithHttpInfoAsync( + String caseId, AttachCaseRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'caseId' is set + if (caseId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'caseId' when calling attachCase")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling attachCase")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security/findings/cases/{case_id}" + .replaceAll("\\{" + "case_id" + "\\}", apiClient.escapeString(caseId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.attachCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Attach security findings to a Jira issue. + * + *

See {@link #attachJiraIssueWithHttpInfo}. + * + * @param body (required) + * @return FindingCaseResponse + * @throws ApiException if fails to make API call + */ + public FindingCaseResponse attachJiraIssue(AttachJiraIssueRequest body) throws ApiException { + return attachJiraIssueWithHttpInfo(body).getData(); + } + + /** + * Attach security findings to a Jira issue. + * + *

See {@link #attachJiraIssueWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<FindingCaseResponse> + */ + public CompletableFuture attachJiraIssueAsync(AttachJiraIssueRequest body) { + return attachJiraIssueWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 (required) + * @return ApiResponse<FindingCaseResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse attachJiraIssueWithHttpInfo(AttachJiraIssueRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling attachJiraIssue"); + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/jira_issues"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.attachJiraIssue", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Attach security findings to a Jira issue. + * + *

See {@link #attachJiraIssueWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<FindingCaseResponse>> + */ + public CompletableFuture> attachJiraIssueWithHttpInfoAsync( + AttachJiraIssueRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling attachJiraIssue")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/jira_issues"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.attachJiraIssue", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Cancel a threat hunting job. * @@ -504,41 +800,323 @@ public ApiResponse convertJobResultToSignalWithHttpInfo( localVarPostBody, new HashMap(), false, - null); + null); + } + + /** + * Convert a job result to a signal. + * + *

See {@link #convertJobResultToSignalWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> convertJobResultToSignalWithHttpInfoAsync( + ConvertJobResultsToSignalsRequest body) { + // Check if unstable operation is enabled + String operationId = "convertJobResultToSignal"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling convertJobResultToSignal")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/siem-threat-hunting/jobs/signal_convert"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.convertJobResultToSignal", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Convert a rule from JSON to Terraform. + * + *

See {@link #convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfo}. + * + * @param body (required) + * @return SecurityMonitoringRuleConvertResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJSONToTerraform( + SecurityMonitoringRuleConvertPayload body) throws ApiException { + return convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfo(body).getData(); + } + + /** + * Convert a rule from JSON to Terraform. + * + *

See {@link #convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<SecurityMonitoringRuleConvertResponse> + */ + public CompletableFuture + convertSecurityMonitoringRuleFromJSONToTerraformAsync( + SecurityMonitoringRuleConvertPayload body) { + return convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Convert a rule that doesn't (yet) exist from JSON to Terraform for Datadog provider resource + * datadog_security_monitoring_rule. You can do so for the following rule types: - + * App and API Protection - Cloud SIEM (log detection and signal correlation) - Workload + * Protection + * + *

You can convert Cloud Security configuration rules using Terraform's Datadog + * Cloud Configuration Rule resource. + * + * @param body (required) + * @return ApiResponse<SecurityMonitoringRuleConvertResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Concurrent Modification -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse + convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfo( + SecurityMonitoringRuleConvertPayload body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " convertSecurityMonitoringRuleFromJSONToTerraform"); + } + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/rules/convert"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.convertSecurityMonitoringRuleFromJSONToTerraform", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Convert a rule from JSON to Terraform. + * + *

See {@link #convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleConvertResponse>> + */ + public CompletableFuture> + convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfoAsync( + SecurityMonitoringRuleConvertPayload body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " convertSecurityMonitoringRuleFromJSONToTerraform")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/rules/convert"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.convertSecurityMonitoringRuleFromJSONToTerraform", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create cases for security findings. + * + *

See {@link #createCasesWithHttpInfo}. + * + * @param body (required) + * @return FindingCaseResponseArray + * @throws ApiException if fails to make API call + */ + public FindingCaseResponseArray createCases(CreateCaseRequestArray body) throws ApiException { + return createCasesWithHttpInfo(body).getData(); + } + + /** + * Create cases for security findings. + * + *

See {@link #createCasesWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<FindingCaseResponseArray> + */ + public CompletableFuture createCasesAsync(CreateCaseRequestArray body) { + return createCasesWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 (required) + * @return ApiResponse<FindingCaseResponseArray> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Created -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse createCasesWithHttpInfo(CreateCaseRequestArray body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createCases"); + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/cases"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createCases", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * Convert a job result to a signal. + * Create cases for security findings. * - *

See {@link #convertJobResultToSignalWithHttpInfo}. + *

See {@link #createCasesWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<Void>> + * @return CompletableFuture<ApiResponse<FindingCaseResponseArray>> */ - public CompletableFuture> convertJobResultToSignalWithHttpInfoAsync( - ConvertJobResultsToSignalsRequest body) { - // Check if unstable operation is enabled - String operationId = "convertJobResultToSignal"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> createCasesWithHttpInfoAsync( + CreateCaseRequestArray body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'body' when calling convertJobResultToSignal")); + new ApiException(400, "Missing the required parameter 'body' when calling createCases")); return result; } // create path and map variables - String localVarPath = "/api/v2/siem-threat-hunting/jobs/signal_convert"; + String localVarPath = "/api/v2/security/findings/cases"; Map localVarHeaderParams = new HashMap(); @@ -546,15 +1124,15 @@ public CompletableFuture> convertJobResultToSignalWithHttpInfo try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.convertJobResultToSignal", + "v2.SecurityMonitoringApi.createCases", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -566,35 +1144,34 @@ public CompletableFuture> convertJobResultToSignalWithHttpInfo localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Convert a rule from JSON to Terraform. + * Create a custom framework. * - *

See {@link #convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfo}. + *

See {@link #createCustomFrameworkWithHttpInfo}. * * @param body (required) - * @return SecurityMonitoringRuleConvertResponse + * @return CreateCustomFrameworkResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJSONToTerraform( - SecurityMonitoringRuleConvertPayload body) throws ApiException { - return convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfo(body).getData(); + public CreateCustomFrameworkResponse createCustomFramework(CreateCustomFrameworkRequest body) + throws ApiException { + return createCustomFrameworkWithHttpInfo(body).getData(); } /** - * Convert a rule from JSON to Terraform. + * Create a custom framework. * - *

See {@link #convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfoAsync}. + *

See {@link #createCustomFrameworkWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<SecurityMonitoringRuleConvertResponse> + * @return CompletableFuture<CreateCustomFrameworkResponse> */ - public CompletableFuture - convertSecurityMonitoringRuleFromJSONToTerraformAsync( - SecurityMonitoringRuleConvertPayload body) { - return convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfoAsync(body) + public CompletableFuture createCustomFrameworkAsync( + CreateCustomFrameworkRequest body) { + return createCustomFrameworkWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -602,17 +1179,10 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS } /** - * Convert a rule that doesn't (yet) exist from JSON to Terraform for Datadog provider resource - * datadog_security_monitoring_rule. You can do so for the following rule types: - - * App and API Protection - Cloud SIEM (log detection and signal correlation) - Workload - * Protection - * - *

You can convert Cloud Security configuration rules using Terraform's Datadog - * Cloud Configuration Rule resource. + * Create a custom framework. * * @param body (required) - * @return ApiResponse<SecurityMonitoringRuleConvertResponse> + * @return ApiResponse<CreateCustomFrameworkResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -620,32 +1190,28 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS * * * - * - * - * + * * + * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Concurrent Modification -
403 Not Authorized -
404 Not Found -
409 Conflict -
429 Too many requests -
500 Bad Request -
*/ - public ApiResponse - convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfo( - SecurityMonitoringRuleConvertPayload body) throws ApiException { + public ApiResponse createCustomFrameworkWithHttpInfo( + CreateCustomFrameworkRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " convertSecurityMonitoringRuleFromJSONToTerraform"); + 400, "Missing the required parameter 'body' when calling createCustomFramework"); } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules/convert"; + String localVarPath = "/api/v2/cloud_security_management/custom_frameworks"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.convertSecurityMonitoringRuleFromJSONToTerraform", + "v2.SecurityMonitoringApi.createCustomFramework", localVarPath, new ArrayList(), localVarHeaderParams, @@ -660,35 +1226,32 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Convert a rule from JSON to Terraform. + * Create a custom framework. * - *

See {@link #convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfo}. + *

See {@link #createCustomFrameworkWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleConvertResponse>> + * @return CompletableFuture<ApiResponse<CreateCustomFrameworkResponse>> */ - public CompletableFuture> - convertSecurityMonitoringRuleFromJSONToTerraformWithHttpInfoAsync( - SecurityMonitoringRuleConvertPayload body) { + public CompletableFuture> + createCustomFrameworkWithHttpInfoAsync(CreateCustomFrameworkRequest body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " convertSecurityMonitoringRuleFromJSONToTerraform")); + 400, "Missing the required parameter 'body' when calling createCustomFramework")); return result; } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules/convert"; + String localVarPath = "/api/v2/cloud_security_management/custom_frameworks"; Map localVarHeaderParams = new HashMap(); @@ -696,7 +1259,7 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.convertSecurityMonitoringRuleFromJSONToTerraform", + "v2.SecurityMonitoringApi.createCustomFramework", localVarPath, new ArrayList(), localVarHeaderParams, @@ -704,7 +1267,7 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -717,34 +1280,34 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a custom framework. + * Create Jira issues for security findings. * - *

See {@link #createCustomFrameworkWithHttpInfo}. + *

See {@link #createJiraIssuesWithHttpInfo}. * * @param body (required) - * @return CreateCustomFrameworkResponse + * @return FindingCaseResponseArray * @throws ApiException if fails to make API call */ - public CreateCustomFrameworkResponse createCustomFramework(CreateCustomFrameworkRequest body) + public FindingCaseResponseArray createJiraIssues(CreateJiraIssueRequestArray body) throws ApiException { - return createCustomFrameworkWithHttpInfo(body).getData(); + return createJiraIssuesWithHttpInfo(body).getData(); } /** - * Create a custom framework. + * Create Jira issues for security findings. * - *

See {@link #createCustomFrameworkWithHttpInfoAsync}. + *

See {@link #createJiraIssuesWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<CreateCustomFrameworkResponse> + * @return CompletableFuture<FindingCaseResponseArray> */ - public CompletableFuture createCustomFrameworkAsync( - CreateCustomFrameworkRequest body) { - return createCustomFrameworkWithHttpInfoAsync(body) + public CompletableFuture createJiraIssuesAsync( + CreateJiraIssueRequestArray body) { + return createJiraIssuesWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -752,39 +1315,42 @@ public CompletableFuture createCustomFrameworkAsy } /** - * Create a custom framework. + * 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 (required) - * @return ApiResponse<CreateCustomFrameworkResponse> + * @return ApiResponse<FindingCaseResponseArray> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * * - * *
Response details
Status Code Description Response Headers
200 OK -
201 Created -
400 Bad Request -
409 Conflict -
404 Not Found -
429 Too many requests -
500 Bad Request -
*/ - public ApiResponse createCustomFrameworkWithHttpInfo( - CreateCustomFrameworkRequest body) throws ApiException { + public ApiResponse createJiraIssuesWithHttpInfo( + CreateJiraIssueRequestArray body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling createCustomFramework"); + 400, "Missing the required parameter 'body' when calling createJiraIssues"); } // create path and map variables - String localVarPath = "/api/v2/cloud_security_management/custom_frameworks"; + String localVarPath = "/api/v2/security/findings/jira_issues"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createCustomFramework", + "v2.SecurityMonitoringApi.createJiraIssues", localVarPath, new ArrayList(), localVarHeaderParams, @@ -799,32 +1365,31 @@ public ApiResponse createCustomFrameworkWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a custom framework. + * Create Jira issues for security findings. * - *

See {@link #createCustomFrameworkWithHttpInfo}. + *

See {@link #createJiraIssuesWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<CreateCustomFrameworkResponse>> + * @return CompletableFuture<ApiResponse<FindingCaseResponseArray>> */ - public CompletableFuture> - createCustomFrameworkWithHttpInfoAsync(CreateCustomFrameworkRequest body) { + public CompletableFuture> createJiraIssuesWithHttpInfoAsync( + CreateJiraIssueRequestArray body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling createCustomFramework")); + 400, "Missing the required parameter 'body' when calling createJiraIssues")); return result; } // create path and map variables - String localVarPath = "/api/v2/cloud_security_management/custom_frameworks"; + String localVarPath = "/api/v2/security/findings/jira_issues"; Map localVarHeaderParams = new HashMap(); @@ -832,7 +1397,7 @@ public ApiResponse createCustomFrameworkWithHttpI try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createCustomFramework", + "v2.SecurityMonitoringApi.createJiraIssues", localVarPath, new ArrayList(), localVarHeaderParams, @@ -840,8 +1405,7 @@ public ApiResponse createCustomFrameworkWithHttpI new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -853,7 +1417,7 @@ public ApiResponse createCustomFrameworkWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -2558,6 +3122,135 @@ public CompletableFuture> deleteVulnerabilityNotificationRuleW null); } + /** + * Detach security findings from their case. + * + *

See {@link #detachCaseWithHttpInfo}. + * + * @param body (required) + * @throws ApiException if fails to make API call + */ + public void detachCase(DetachCaseRequest body) throws ApiException { + detachCaseWithHttpInfo(body); + } + + /** + * Detach security findings from their case. + * + *

See {@link #detachCaseWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture + */ + public CompletableFuture detachCaseAsync(DetachCaseRequest body) { + return detachCaseWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse detachCaseWithHttpInfo(DetachCaseRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling detachCase"); + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/cases"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.detachCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Detach security findings from their case. + * + *

See {@link #detachCaseWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> detachCaseWithHttpInfoAsync(DetachCaseRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling detachCase")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/cases"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.detachCase", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + null); + } + /** * Modify the triage assignee of a security signal. * @@ -10643,7 +11336,7 @@ public ApiResponse muteFindingsWithHttpInfo( localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "PATCH", builder, @@ -10708,7 +11401,7 @@ public CompletableFuture> muteFindingsWith localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequest.java b/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequest.java new file mode 100644 index 00000000000..d168a9106c5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequest.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request for attaching security findings to a case. */ +@JsonPropertyOrder({AttachCaseRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachCaseRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AttachCaseRequestData data; + + public AttachCaseRequest data(AttachCaseRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the case to attach security findings to. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AttachCaseRequestData getData() { + return data; + } + + public void setData(AttachCaseRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AttachCaseRequest + */ + @JsonAnySetter + public AttachCaseRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AttachCaseRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachCaseRequest attachCaseRequest = (AttachCaseRequest) o; + return Objects.equals(this.data, attachCaseRequest.data) + && Objects.equals(this.additionalProperties, attachCaseRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachCaseRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestData.java b/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestData.java new file mode 100644 index 00000000000..a1ef2258de0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestData.java @@ -0,0 +1,206 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data of the case to attach security findings to. */ +@JsonPropertyOrder({ + AttachCaseRequestData.JSON_PROPERTY_ID, + AttachCaseRequestData.JSON_PROPERTY_RELATIONSHIPS, + AttachCaseRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachCaseRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private AttachCaseRequestDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseDataType type = CaseDataType.CASES; + + public AttachCaseRequestData() {} + + @JsonCreator + public AttachCaseRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AttachCaseRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the case. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AttachCaseRequestData relationships(AttachCaseRequestDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the case to attach security findings to. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AttachCaseRequestDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(AttachCaseRequestDataRelationships relationships) { + this.relationships = relationships; + } + + public AttachCaseRequestData type(CaseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Cases resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseDataType getType() { + return type; + } + + public void setType(CaseDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AttachCaseRequestData + */ + @JsonAnySetter + public AttachCaseRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AttachCaseRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachCaseRequestData attachCaseRequestData = (AttachCaseRequestData) o; + return Objects.equals(this.id, attachCaseRequestData.id) + && Objects.equals(this.relationships, attachCaseRequestData.relationships) + && Objects.equals(this.type, attachCaseRequestData.type) + && Objects.equals(this.additionalProperties, attachCaseRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachCaseRequestData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestDataRelationships.java new file mode 100644 index 00000000000..ec56b9751c1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachCaseRequestDataRelationships.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of the case to attach security findings to. */ +@JsonPropertyOrder({AttachCaseRequestDataRelationships.JSON_PROPERTY_FINDINGS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachCaseRequestDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FINDINGS = "findings"; + private Findings findings; + + public AttachCaseRequestDataRelationships() {} + + @JsonCreator + public AttachCaseRequestDataRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_FINDINGS) Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + } + + public AttachCaseRequestDataRelationships findings(Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + return this; + } + + /** + * A list of security findings. + * + * @return findings + */ + @JsonProperty(JSON_PROPERTY_FINDINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Findings getFindings() { + return findings; + } + + public void setFindings(Findings findings) { + this.findings = findings; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AttachCaseRequestDataRelationships + */ + @JsonAnySetter + public AttachCaseRequestDataRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AttachCaseRequestDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachCaseRequestDataRelationships attachCaseRequestDataRelationships = + (AttachCaseRequestDataRelationships) o; + return Objects.equals(this.findings, attachCaseRequestDataRelationships.findings) + && Objects.equals( + this.additionalProperties, attachCaseRequestDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(findings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachCaseRequestDataRelationships {\n"); + sb.append(" findings: ").append(toIndentedString(findings)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequest.java b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequest.java new file mode 100644 index 00000000000..cc64dfb9888 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequest.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request for attaching security findings to a Jira issue. */ +@JsonPropertyOrder({AttachJiraIssueRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachJiraIssueRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AttachJiraIssueRequestData data; + + public AttachJiraIssueRequest data(AttachJiraIssueRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the Jira issue to attach security findings to. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AttachJiraIssueRequestData getData() { + return data; + } + + public void setData(AttachJiraIssueRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AttachJiraIssueRequest + */ + @JsonAnySetter + public AttachJiraIssueRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AttachJiraIssueRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachJiraIssueRequest attachJiraIssueRequest = (AttachJiraIssueRequest) o; + return Objects.equals(this.data, attachJiraIssueRequest.data) + && Objects.equals(this.additionalProperties, attachJiraIssueRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachJiraIssueRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestData.java b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestData.java new file mode 100644 index 00000000000..3656fafca81 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestData.java @@ -0,0 +1,235 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data of the Jira issue to attach security findings to. */ +@JsonPropertyOrder({ + AttachJiraIssueRequestData.JSON_PROPERTY_ATTRIBUTES, + AttachJiraIssueRequestData.JSON_PROPERTY_ID, + AttachJiraIssueRequestData.JSON_PROPERTY_RELATIONSHIPS, + AttachJiraIssueRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachJiraIssueRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AttachJiraIssueRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private AttachJiraIssueRequestDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private JiraIssuesDataType type = JiraIssuesDataType.JIRA_ISSUES; + + public AttachJiraIssueRequestData() {} + + @JsonCreator + public AttachJiraIssueRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) JiraIssuesDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AttachJiraIssueRequestData attributes(AttachJiraIssueRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the Jira issue to attach security findings to. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AttachJiraIssueRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AttachJiraIssueRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public AttachJiraIssueRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the Jira issue attachment request. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AttachJiraIssueRequestData relationships( + AttachJiraIssueRequestDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the Jira issue to attach security findings to. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AttachJiraIssueRequestDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(AttachJiraIssueRequestDataRelationships relationships) { + this.relationships = relationships; + } + + public AttachJiraIssueRequestData type(JiraIssuesDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Jira issues resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JiraIssuesDataType getType() { + return type; + } + + public void setType(JiraIssuesDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AttachJiraIssueRequestData + */ + @JsonAnySetter + public AttachJiraIssueRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AttachJiraIssueRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachJiraIssueRequestData attachJiraIssueRequestData = (AttachJiraIssueRequestData) o; + return Objects.equals(this.attributes, attachJiraIssueRequestData.attributes) + && Objects.equals(this.id, attachJiraIssueRequestData.id) + && Objects.equals(this.relationships, attachJiraIssueRequestData.relationships) + && Objects.equals(this.type, attachJiraIssueRequestData.type) + && Objects.equals( + this.additionalProperties, attachJiraIssueRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachJiraIssueRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataAttributes.java new file mode 100644 index 00000000000..eb1b027c265 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataAttributes.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the Jira issue to attach security findings to. */ +@JsonPropertyOrder({AttachJiraIssueRequestDataAttributes.JSON_PROPERTY_JIRA_ISSUE_URL}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachJiraIssueRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_JIRA_ISSUE_URL = "jira_issue_url"; + private String jiraIssueUrl; + + public AttachJiraIssueRequestDataAttributes() {} + + @JsonCreator + public AttachJiraIssueRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_JIRA_ISSUE_URL) String jiraIssueUrl) { + this.jiraIssueUrl = jiraIssueUrl; + } + + public AttachJiraIssueRequestDataAttributes jiraIssueUrl(String jiraIssueUrl) { + this.jiraIssueUrl = jiraIssueUrl; + return this; + } + + /** + * The URL of the Jira issue to attach security findings to. + * + * @return jiraIssueUrl + */ + @JsonProperty(JSON_PROPERTY_JIRA_ISSUE_URL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getJiraIssueUrl() { + return jiraIssueUrl; + } + + public void setJiraIssueUrl(String jiraIssueUrl) { + this.jiraIssueUrl = jiraIssueUrl; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AttachJiraIssueRequestDataAttributes + */ + @JsonAnySetter + public AttachJiraIssueRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AttachJiraIssueRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachJiraIssueRequestDataAttributes attachJiraIssueRequestDataAttributes = + (AttachJiraIssueRequestDataAttributes) o; + return Objects.equals(this.jiraIssueUrl, attachJiraIssueRequestDataAttributes.jiraIssueUrl) + && Objects.equals( + this.additionalProperties, attachJiraIssueRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(jiraIssueUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachJiraIssueRequestDataAttributes {\n"); + sb.append(" jiraIssueUrl: ").append(toIndentedString(jiraIssueUrl)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataRelationships.java new file mode 100644 index 00000000000..03f92afc03a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AttachJiraIssueRequestDataRelationships.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of the Jira issue to attach security findings to. */ +@JsonPropertyOrder({ + AttachJiraIssueRequestDataRelationships.JSON_PROPERTY_FINDINGS, + AttachJiraIssueRequestDataRelationships.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AttachJiraIssueRequestDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FINDINGS = "findings"; + private Findings findings; + + public static final String JSON_PROPERTY_PROJECT = "project"; + private CaseManagementProject project; + + public AttachJiraIssueRequestDataRelationships() {} + + @JsonCreator + public AttachJiraIssueRequestDataRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_FINDINGS) Findings findings, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT) CaseManagementProject project) { + this.findings = findings; + this.unparsed |= findings.unparsed; + this.project = project; + this.unparsed |= project.unparsed; + } + + public AttachJiraIssueRequestDataRelationships findings(Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + return this; + } + + /** + * A list of security findings. + * + * @return findings + */ + @JsonProperty(JSON_PROPERTY_FINDINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Findings getFindings() { + return findings; + } + + public void setFindings(Findings findings) { + this.findings = findings; + } + + public AttachJiraIssueRequestDataRelationships project(CaseManagementProject project) { + this.project = project; + this.unparsed |= project.unparsed; + return this; + } + + /** + * Case management project. + * + * @return project + */ + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseManagementProject getProject() { + return project; + } + + public void setProject(CaseManagementProject project) { + this.project = project; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AttachJiraIssueRequestDataRelationships + */ + @JsonAnySetter + public AttachJiraIssueRequestDataRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AttachJiraIssueRequestDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AttachJiraIssueRequestDataRelationships attachJiraIssueRequestDataRelationships = + (AttachJiraIssueRequestDataRelationships) o; + return Objects.equals(this.findings, attachJiraIssueRequestDataRelationships.findings) + && Objects.equals(this.project, attachJiraIssueRequestDataRelationships.project) + && Objects.equals( + this.additionalProperties, + attachJiraIssueRequestDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(findings, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AttachJiraIssueRequestDataRelationships {\n"); + sb.append(" findings: ").append(toIndentedString(findings)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseDataType.java b/src/main/java/com/datadog/api/client/v2/model/CaseDataType.java new file mode 100644 index 00000000000..c594fe30f49 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseDataType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Cases resource type. */ +@JsonSerialize(using = CaseDataType.CaseDataTypeSerializer.class) +public class CaseDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("cases")); + + public static final CaseDataType CASES = new CaseDataType("cases"); + + CaseDataType(String value) { + super(value, allowedValues); + } + + public static class CaseDataTypeSerializer extends StdSerializer { + public CaseDataTypeSerializer(Class t) { + super(t); + } + + public CaseDataTypeSerializer() { + this(null); + } + + @Override + public void serialize(CaseDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseDataType fromValue(String value) { + return new CaseDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseInsightsItems.java b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsItems.java new file mode 100644 index 00000000000..5862079f5d7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseInsightsItems.java @@ -0,0 +1,192 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** An insight of the case. */ +@JsonPropertyOrder({ + CaseInsightsItems.JSON_PROPERTY_REF, + CaseInsightsItems.JSON_PROPERTY_RESOURCE_ID, + CaseInsightsItems.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseInsightsItems { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REF = "ref"; + private String ref; + + public static final String JSON_PROPERTY_RESOURCE_ID = "resource_id"; + private String resourceId; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public CaseInsightsItems ref(String ref) { + this.ref = ref; + return this; + } + + /** + * The reference of the insight. + * + * @return ref + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRef() { + return ref; + } + + public void setRef(String ref) { + this.ref = ref; + } + + public CaseInsightsItems resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * The unique identifier of the resource. For example, the unique identifier of a security + * finding. + * + * @return resourceId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public CaseInsightsItems type(String type) { + this.type = type; + return this; + } + + /** + * The type of the resource. For example, the type of a security finding is "SECURITY_FINDING". + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseInsightsItems + */ + @JsonAnySetter + public CaseInsightsItems putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseInsightsItems object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseInsightsItems caseInsightsItems = (CaseInsightsItems) o; + return Objects.equals(this.ref, caseInsightsItems.ref) + && Objects.equals(this.resourceId, caseInsightsItems.resourceId) + && Objects.equals(this.type, caseInsightsItems.type) + && Objects.equals(this.additionalProperties, caseInsightsItems.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ref, resourceId, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseInsightsItems {\n"); + sb.append(" ref: ").append(toIndentedString(ref)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseManagementProject.java b/src/main/java/com/datadog/api/client/v2/model/CaseManagementProject.java new file mode 100644 index 00000000000..095923da858 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseManagementProject.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Case management project. */ +@JsonPropertyOrder({CaseManagementProject.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseManagementProject { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CaseManagementProjectData data; + + public CaseManagementProject() {} + + @JsonCreator + public CaseManagementProject( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CaseManagementProjectData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CaseManagementProject data(CaseManagementProjectData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseManagementProjectData getData() { + return data; + } + + public void setData(CaseManagementProjectData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseManagementProject + */ + @JsonAnySetter + public CaseManagementProject putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseManagementProject object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseManagementProject caseManagementProject = (CaseManagementProject) o; + return Objects.equals(this.data, caseManagementProject.data) + && Objects.equals(this.additionalProperties, caseManagementProject.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseManagementProject {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectData.java b/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectData.java new file mode 100644 index 00000000000..c3022188b1c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectData.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({ + CaseManagementProjectData.JSON_PROPERTY_ID, + CaseManagementProjectData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CaseManagementProjectData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseManagementProjectDataType type = CaseManagementProjectDataType.PROJECTS; + + public CaseManagementProjectData() {} + + @JsonCreator + public CaseManagementProjectData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CaseManagementProjectDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CaseManagementProjectData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the case management project. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CaseManagementProjectData type(CaseManagementProjectDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Projects resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseManagementProjectDataType getType() { + return type; + } + + public void setType(CaseManagementProjectDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CaseManagementProjectData + */ + @JsonAnySetter + public CaseManagementProjectData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CaseManagementProjectData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaseManagementProjectData caseManagementProjectData = (CaseManagementProjectData) o; + return Objects.equals(this.id, caseManagementProjectData.id) + && Objects.equals(this.type, caseManagementProjectData.type) + && Objects.equals( + this.additionalProperties, caseManagementProjectData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaseManagementProjectData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectDataType.java b/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectDataType.java new file mode 100644 index 00000000000..02106beccbc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CaseManagementProjectDataType.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Projects resource type. */ +@JsonSerialize(using = CaseManagementProjectDataType.CaseManagementProjectDataTypeSerializer.class) +public class CaseManagementProjectDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("projects")); + + public static final CaseManagementProjectDataType PROJECTS = + new CaseManagementProjectDataType("projects"); + + CaseManagementProjectDataType(String value) { + super(value, allowedValues); + } + + public static class CaseManagementProjectDataTypeSerializer + extends StdSerializer { + public CaseManagementProjectDataTypeSerializer(Class t) { + super(t); + } + + public CaseManagementProjectDataTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CaseManagementProjectDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CaseManagementProjectDataType fromValue(String value) { + return new CaseManagementProjectDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestArray.java b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestArray.java new file mode 100644 index 00000000000..99a0c6dd9f9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestArray.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** List of requests to create cases for security findings. */ +@JsonPropertyOrder({CreateCaseRequestArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateCaseRequestArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public CreateCaseRequestArray() {} + + @JsonCreator + public CreateCaseRequestArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public CreateCaseRequestArray data(List data) { + this.data = data; + for (CreateCaseRequestData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateCaseRequestArray addDataItem(CreateCaseRequestData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateCaseRequestArray + */ + @JsonAnySetter + public CreateCaseRequestArray putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateCaseRequestArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCaseRequestArray createCaseRequestArray = (CreateCaseRequestArray) o; + return Objects.equals(this.data, createCaseRequestArray.data) + && Objects.equals(this.additionalProperties, createCaseRequestArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCaseRequestArray {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestData.java new file mode 100644 index 00000000000..2895492d618 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestData.java @@ -0,0 +1,233 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data of the case to create. */ +@JsonPropertyOrder({ + CreateCaseRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateCaseRequestData.JSON_PROPERTY_ID, + CreateCaseRequestData.JSON_PROPERTY_RELATIONSHIPS, + CreateCaseRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateCaseRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateCaseRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private CreateCaseRequestDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseDataType type = CaseDataType.CASES; + + public CreateCaseRequestData() {} + + @JsonCreator + public CreateCaseRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateCaseRequestData attributes(CreateCaseRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the case to create. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateCaseRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateCaseRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateCaseRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the case. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CreateCaseRequestData relationships(CreateCaseRequestDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the case to create. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateCaseRequestDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(CreateCaseRequestDataRelationships relationships) { + this.relationships = relationships; + } + + public CreateCaseRequestData type(CaseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Cases resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseDataType getType() { + return type; + } + + public void setType(CaseDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateCaseRequestData + */ + @JsonAnySetter + public CreateCaseRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateCaseRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCaseRequestData createCaseRequestData = (CreateCaseRequestData) o; + return Objects.equals(this.attributes, createCaseRequestData.attributes) + && Objects.equals(this.id, createCaseRequestData.id) + && Objects.equals(this.relationships, createCaseRequestData.relationships) + && Objects.equals(this.type, createCaseRequestData.type) + && Objects.equals(this.additionalProperties, createCaseRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCaseRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataAttributes.java new file mode 100644 index 00000000000..06d5c96adff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataAttributes.java @@ -0,0 +1,224 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the case to create. */ +@JsonPropertyOrder({ + CreateCaseRequestDataAttributes.JSON_PROPERTY_ASSIGNEE_ID, + CreateCaseRequestDataAttributes.JSON_PROPERTY_DESCRIPTION, + CreateCaseRequestDataAttributes.JSON_PROPERTY_PRIORITY, + CreateCaseRequestDataAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateCaseRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + private String assigneeId; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private CasePriority priority = CasePriority.NOT_DEFINED; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public CreateCaseRequestDataAttributes assigneeId(String assigneeId) { + this.assigneeId = assigneeId; + return this; + } + + /** + * The unique identifier of the user assigned to the case. + * + * @return assigneeId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAssigneeId() { + return assigneeId; + } + + public void setAssigneeId(String assigneeId) { + this.assigneeId = assigneeId; + } + + public CreateCaseRequestDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the case. If not provided, the description will be automatically generated. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public CreateCaseRequestDataAttributes priority(CasePriority priority) { + this.priority = priority; + this.unparsed |= !priority.isValid(); + return this; + } + + /** + * Case priority + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CasePriority getPriority() { + return priority; + } + + public void setPriority(CasePriority priority) { + if (!priority.isValid()) { + this.unparsed = true; + } + this.priority = priority; + } + + public CreateCaseRequestDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the case. If not provided, the title will be automatically generated. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateCaseRequestDataAttributes + */ + @JsonAnySetter + public CreateCaseRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateCaseRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCaseRequestDataAttributes createCaseRequestDataAttributes = + (CreateCaseRequestDataAttributes) o; + return Objects.equals(this.assigneeId, createCaseRequestDataAttributes.assigneeId) + && Objects.equals(this.description, createCaseRequestDataAttributes.description) + && Objects.equals(this.priority, createCaseRequestDataAttributes.priority) + && Objects.equals(this.title, createCaseRequestDataAttributes.title) + && Objects.equals( + this.additionalProperties, createCaseRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assigneeId, description, priority, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCaseRequestDataAttributes {\n"); + sb.append(" assigneeId: ").append(toIndentedString(assigneeId)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataRelationships.java new file mode 100644 index 00000000000..b42c1dd092d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateCaseRequestDataRelationships.java @@ -0,0 +1,179 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of the case to create. */ +@JsonPropertyOrder({ + CreateCaseRequestDataRelationships.JSON_PROPERTY_FINDINGS, + CreateCaseRequestDataRelationships.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateCaseRequestDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FINDINGS = "findings"; + private Findings findings; + + public static final String JSON_PROPERTY_PROJECT = "project"; + private CaseManagementProject project; + + public CreateCaseRequestDataRelationships() {} + + @JsonCreator + public CreateCaseRequestDataRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_FINDINGS) Findings findings, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT) CaseManagementProject project) { + this.findings = findings; + this.unparsed |= findings.unparsed; + this.project = project; + this.unparsed |= project.unparsed; + } + + public CreateCaseRequestDataRelationships findings(Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + return this; + } + + /** + * A list of security findings. + * + * @return findings + */ + @JsonProperty(JSON_PROPERTY_FINDINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Findings getFindings() { + return findings; + } + + public void setFindings(Findings findings) { + this.findings = findings; + } + + public CreateCaseRequestDataRelationships project(CaseManagementProject project) { + this.project = project; + this.unparsed |= project.unparsed; + return this; + } + + /** + * Case management project. + * + * @return project + */ + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseManagementProject getProject() { + return project; + } + + public void setProject(CaseManagementProject project) { + this.project = project; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateCaseRequestDataRelationships + */ + @JsonAnySetter + public CreateCaseRequestDataRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateCaseRequestDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateCaseRequestDataRelationships createCaseRequestDataRelationships = + (CreateCaseRequestDataRelationships) o; + return Objects.equals(this.findings, createCaseRequestDataRelationships.findings) + && Objects.equals(this.project, createCaseRequestDataRelationships.project) + && Objects.equals( + this.additionalProperties, createCaseRequestDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(findings, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateCaseRequestDataRelationships {\n"); + sb.append(" findings: ").append(toIndentedString(findings)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArray.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArray.java new file mode 100644 index 00000000000..67aab168087 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArray.java @@ -0,0 +1,198 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** List of requests to create Jira issues for security findings. */ +@JsonPropertyOrder({ + CreateJiraIssueRequestArray.JSON_PROPERTY_DATA, + CreateJiraIssueRequestArray.JSON_PROPERTY_INCLUDED +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateJiraIssueRequestArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public CreateJiraIssueRequestArray() {} + + @JsonCreator + public CreateJiraIssueRequestArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public CreateJiraIssueRequestArray data(List data) { + this.data = data; + for (CreateJiraIssueRequestData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateJiraIssueRequestArray addDataItem(CreateJiraIssueRequestData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public CreateJiraIssueRequestArray included(List included) { + this.included = included; + for (CreateJiraIssueRequestArrayIncluded item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CreateJiraIssueRequestArray addIncludedItem( + CreateJiraIssueRequestArrayIncluded includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Getincluded + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateJiraIssueRequestArray + */ + @JsonAnySetter + public CreateJiraIssueRequestArray putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateJiraIssueRequestArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJiraIssueRequestArray createJiraIssueRequestArray = (CreateJiraIssueRequestArray) o; + return Objects.equals(this.data, createJiraIssueRequestArray.data) + && Objects.equals(this.included, createJiraIssueRequestArray.included) + && Objects.equals( + this.additionalProperties, createJiraIssueRequestArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJiraIssueRequestArray {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArrayIncluded.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArrayIncluded.java new file mode 100644 index 00000000000..560f748d275 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestArrayIncluded.java @@ -0,0 +1,352 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize( + using = + CreateJiraIssueRequestArrayIncluded.CreateJiraIssueRequestArrayIncludedDeserializer.class) +@JsonSerialize( + using = CreateJiraIssueRequestArrayIncluded.CreateJiraIssueRequestArrayIncludedSerializer.class) +public class CreateJiraIssueRequestArrayIncluded extends AbstractOpenApiSchema { + private static final Logger log = + Logger.getLogger(CreateJiraIssueRequestArrayIncluded.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class CreateJiraIssueRequestArrayIncludedSerializer + extends StdSerializer { + public CreateJiraIssueRequestArrayIncludedSerializer( + Class t) { + super(t); + } + + public CreateJiraIssueRequestArrayIncludedSerializer() { + this(null); + } + + @Override + public void serialize( + CreateJiraIssueRequestArrayIncluded value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class CreateJiraIssueRequestArrayIncludedDeserializer + extends StdDeserializer { + public CreateJiraIssueRequestArrayIncludedDeserializer() { + this(CreateJiraIssueRequestArrayIncluded.class); + } + + public CreateJiraIssueRequestArrayIncludedDeserializer(Class vc) { + super(vc); + } + + @Override + public CreateJiraIssueRequestArrayIncluded deserialize( + JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize CreateCaseRequestData + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CreateCaseRequestData.class.equals(Integer.class) + || CreateCaseRequestData.class.equals(Long.class) + || CreateCaseRequestData.class.equals(Float.class) + || CreateCaseRequestData.class.equals(Double.class) + || CreateCaseRequestData.class.equals(Boolean.class) + || CreateCaseRequestData.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CreateCaseRequestData.class.equals(Integer.class) + || CreateCaseRequestData.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CreateCaseRequestData.class.equals(Float.class) + || CreateCaseRequestData.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CreateCaseRequestData.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CreateCaseRequestData.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CreateCaseRequestData.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CreateCaseRequestData) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CreateCaseRequestData'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'CreateCaseRequestData'", e); + } + + // deserialize CaseManagementProjectData + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CaseManagementProjectData.class.equals(Integer.class) + || CaseManagementProjectData.class.equals(Long.class) + || CaseManagementProjectData.class.equals(Float.class) + || CaseManagementProjectData.class.equals(Double.class) + || CaseManagementProjectData.class.equals(Boolean.class) + || CaseManagementProjectData.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CaseManagementProjectData.class.equals(Integer.class) + || CaseManagementProjectData.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CaseManagementProjectData.class.equals(Float.class) + || CaseManagementProjectData.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CaseManagementProjectData.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CaseManagementProjectData.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CaseManagementProjectData.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((CaseManagementProjectData) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CaseManagementProjectData'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'CaseManagementProjectData'", e); + } + + // deserialize FindingData + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (FindingData.class.equals(Integer.class) + || FindingData.class.equals(Long.class) + || FindingData.class.equals(Float.class) + || FindingData.class.equals(Double.class) + || FindingData.class.equals(Boolean.class) + || FindingData.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((FindingData.class.equals(Integer.class) || FindingData.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((FindingData.class.equals(Float.class) || FindingData.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (FindingData.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (FindingData.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(FindingData.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((FindingData) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'FindingData'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'FindingData'", e); + } + + CreateJiraIssueRequestArrayIncluded ret = new CreateJiraIssueRequestArrayIncluded(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public CreateJiraIssueRequestArrayIncluded getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "CreateJiraIssueRequestArrayIncluded cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public CreateJiraIssueRequestArrayIncluded() { + super("oneOf", Boolean.FALSE); + } + + public CreateJiraIssueRequestArrayIncluded(CreateCaseRequestData o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public CreateJiraIssueRequestArrayIncluded(CaseManagementProjectData o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public CreateJiraIssueRequestArrayIncluded(FindingData o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("CreateCaseRequestData", new GenericType() {}); + schemas.put("CaseManagementProjectData", new GenericType() {}); + schemas.put("FindingData", new GenericType() {}); + JSON.registerDescendants( + CreateJiraIssueRequestArrayIncluded.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return CreateJiraIssueRequestArrayIncluded.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: CreateCaseRequestData, CaseManagementProjectData, FindingData + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(CreateCaseRequestData.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(CaseManagementProjectData.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(FindingData.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be CreateCaseRequestData, CaseManagementProjectData," + + " FindingData"); + } + + /** + * Get the actual instance, which can be the following: CreateCaseRequestData, + * CaseManagementProjectData, FindingData + * + * @return The actual instance (CreateCaseRequestData, CaseManagementProjectData, FindingData) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `CreateCaseRequestData`. If the actual instance is not + * `CreateCaseRequestData`, the ClassCastException will be thrown. + * + * @return The actual instance of `CreateCaseRequestData` + * @throws ClassCastException if the instance is not `CreateCaseRequestData` + */ + public CreateCaseRequestData getCreateCaseRequestData() throws ClassCastException { + return (CreateCaseRequestData) super.getActualInstance(); + } + + /** + * Get the actual instance of `CaseManagementProjectData`. If the actual instance is not + * `CaseManagementProjectData`, the ClassCastException will be thrown. + * + * @return The actual instance of `CaseManagementProjectData` + * @throws ClassCastException if the instance is not `CaseManagementProjectData` + */ + public CaseManagementProjectData getCaseManagementProjectData() throws ClassCastException { + return (CaseManagementProjectData) super.getActualInstance(); + } + + /** + * Get the actual instance of `FindingData`. If the actual instance is not `FindingData`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `FindingData` + * @throws ClassCastException if the instance is not `FindingData` + */ + public FindingData getFindingData() throws ClassCastException { + return (FindingData) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestData.java new file mode 100644 index 00000000000..35922b30390 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestData.java @@ -0,0 +1,235 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data of the Jira issue to create. */ +@JsonPropertyOrder({ + CreateJiraIssueRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateJiraIssueRequestData.JSON_PROPERTY_ID, + CreateJiraIssueRequestData.JSON_PROPERTY_RELATIONSHIPS, + CreateJiraIssueRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateJiraIssueRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateJiraIssueRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private CreateJiraIssueRequestDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private JiraIssuesDataType type = JiraIssuesDataType.JIRA_ISSUES; + + public CreateJiraIssueRequestData() {} + + @JsonCreator + public CreateJiraIssueRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) JiraIssuesDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateJiraIssueRequestData attributes(CreateJiraIssueRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the Jira issue to create. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateJiraIssueRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateJiraIssueRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateJiraIssueRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the Jira issue creation request. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CreateJiraIssueRequestData relationships( + CreateJiraIssueRequestDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the Jira issue to create. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateJiraIssueRequestDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(CreateJiraIssueRequestDataRelationships relationships) { + this.relationships = relationships; + } + + public CreateJiraIssueRequestData type(JiraIssuesDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Jira issues resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public JiraIssuesDataType getType() { + return type; + } + + public void setType(JiraIssuesDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateJiraIssueRequestData + */ + @JsonAnySetter + public CreateJiraIssueRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateJiraIssueRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJiraIssueRequestData createJiraIssueRequestData = (CreateJiraIssueRequestData) o; + return Objects.equals(this.attributes, createJiraIssueRequestData.attributes) + && Objects.equals(this.id, createJiraIssueRequestData.id) + && Objects.equals(this.relationships, createJiraIssueRequestData.relationships) + && Objects.equals(this.type, createJiraIssueRequestData.type) + && Objects.equals( + this.additionalProperties, createJiraIssueRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJiraIssueRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java new file mode 100644 index 00000000000..1407bc55a0b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributes.java @@ -0,0 +1,141 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the Jira issue to create. */ +@JsonPropertyOrder({CreateJiraIssueRequestDataAttributes.JSON_PROPERTY_FIELDS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateJiraIssueRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELDS = "fields"; + private CreateJiraIssueRequestDataAttributesFields fields; + + public CreateJiraIssueRequestDataAttributes fields( + CreateJiraIssueRequestDataAttributesFields fields) { + this.fields = fields; + this.unparsed |= fields.unparsed; + return this; + } + + /** + * Custom fields of the Jira issue to create. For the list of available fields, see Jira + * documentation. + * + * @return fields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateJiraIssueRequestDataAttributesFields getFields() { + return fields; + } + + public void setFields(CreateJiraIssueRequestDataAttributesFields fields) { + this.fields = fields; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateJiraIssueRequestDataAttributes + */ + @JsonAnySetter + public CreateJiraIssueRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateJiraIssueRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJiraIssueRequestDataAttributes createJiraIssueRequestDataAttributes = + (CreateJiraIssueRequestDataAttributes) o; + return Objects.equals(this.fields, createJiraIssueRequestDataAttributes.fields) + && Objects.equals( + this.additionalProperties, createJiraIssueRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJiraIssueRequestDataAttributes {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributesFields.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributesFields.java new file mode 100644 index 00000000000..f8422c156b7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataAttributesFields.java @@ -0,0 +1,143 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Custom fields of the Jira issue to create. For the list of available fields, see Jira + * documentation. + */ +@JsonPropertyOrder({CreateJiraIssueRequestDataAttributesFields.JSON_PROPERTY_FIELDS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateJiraIssueRequestDataAttributesFields { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIELDS = "fields"; + private Object fields; + + public CreateJiraIssueRequestDataAttributesFields fields(Object fields) { + this.fields = fields; + return this; + } + + /** + * Getfields + * + * @return fields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getFields() { + return fields; + } + + public void setFields(Object fields) { + this.fields = fields; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateJiraIssueRequestDataAttributesFields + */ + @JsonAnySetter + public CreateJiraIssueRequestDataAttributesFields putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateJiraIssueRequestDataAttributesFields object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJiraIssueRequestDataAttributesFields createJiraIssueRequestDataAttributesFields = + (CreateJiraIssueRequestDataAttributesFields) o; + return Objects.equals(this.fields, createJiraIssueRequestDataAttributesFields.fields) + && Objects.equals( + this.additionalProperties, + createJiraIssueRequestDataAttributesFields.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fields, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJiraIssueRequestDataAttributesFields {\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationships.java new file mode 100644 index 00000000000..83289c82801 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationships.java @@ -0,0 +1,150 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of the Jira issue to create. */ +@JsonPropertyOrder({CreateJiraIssueRequestDataRelationships.JSON_PROPERTY_CASE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateJiraIssueRequestDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CASE = "case"; + private CreateJiraIssueRequestDataRelationshipsCase _case; + + public CreateJiraIssueRequestDataRelationships() {} + + @JsonCreator + public CreateJiraIssueRequestDataRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_CASE) + CreateJiraIssueRequestDataRelationshipsCase _case) { + this._case = _case; + this.unparsed |= _case.unparsed; + } + + public CreateJiraIssueRequestDataRelationships _case( + CreateJiraIssueRequestDataRelationshipsCase _case) { + this._case = _case; + this.unparsed |= _case.unparsed; + return this; + } + + /** + * Case linked to the Jira issue. + * + * @return _case + */ + @JsonProperty(JSON_PROPERTY_CASE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateJiraIssueRequestDataRelationshipsCase getCase() { + return _case; + } + + public void setCase(CreateJiraIssueRequestDataRelationshipsCase _case) { + this._case = _case; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateJiraIssueRequestDataRelationships + */ + @JsonAnySetter + public CreateJiraIssueRequestDataRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateJiraIssueRequestDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJiraIssueRequestDataRelationships createJiraIssueRequestDataRelationships = + (CreateJiraIssueRequestDataRelationships) o; + return Objects.equals(this._case, createJiraIssueRequestDataRelationships._case) + && Objects.equals( + this.additionalProperties, + createJiraIssueRequestDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(_case, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJiraIssueRequestDataRelationships {\n"); + sb.append(" _case: ").append(toIndentedString(_case)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCase.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCase.java new file mode 100644 index 00000000000..16be0370780 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCase.java @@ -0,0 +1,151 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Case linked to the Jira issue. */ +@JsonPropertyOrder({CreateJiraIssueRequestDataRelationshipsCase.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateJiraIssueRequestDataRelationshipsCase { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateJiraIssueRequestDataRelationshipsCaseData data; + + public CreateJiraIssueRequestDataRelationshipsCase() {} + + @JsonCreator + public CreateJiraIssueRequestDataRelationshipsCase( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + CreateJiraIssueRequestDataRelationshipsCaseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CreateJiraIssueRequestDataRelationshipsCase data( + CreateJiraIssueRequestDataRelationshipsCaseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Case linked to the Jira issue. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateJiraIssueRequestDataRelationshipsCaseData getData() { + return data; + } + + public void setData(CreateJiraIssueRequestDataRelationshipsCaseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateJiraIssueRequestDataRelationshipsCase + */ + @JsonAnySetter + public CreateJiraIssueRequestDataRelationshipsCase putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateJiraIssueRequestDataRelationshipsCase object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJiraIssueRequestDataRelationshipsCase createJiraIssueRequestDataRelationshipsCase = + (CreateJiraIssueRequestDataRelationshipsCase) o; + return Objects.equals(this.data, createJiraIssueRequestDataRelationshipsCase.data) + && Objects.equals( + this.additionalProperties, + createJiraIssueRequestDataRelationshipsCase.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJiraIssueRequestDataRelationshipsCase {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCaseData.java b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCaseData.java new file mode 100644 index 00000000000..7f7952c51d2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateJiraIssueRequestDataRelationshipsCaseData.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Case linked to the Jira issue. */ +@JsonPropertyOrder({ + CreateJiraIssueRequestDataRelationshipsCaseData.JSON_PROPERTY_ID, + CreateJiraIssueRequestDataRelationshipsCaseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateJiraIssueRequestDataRelationshipsCaseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseDataType type = CaseDataType.CASES; + + public CreateJiraIssueRequestDataRelationshipsCaseData() {} + + @JsonCreator + public CreateJiraIssueRequestDataRelationshipsCaseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateJiraIssueRequestDataRelationshipsCaseData id(String id) { + this.id = id; + return this; + } + + /** + * Getid + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public CreateJiraIssueRequestDataRelationshipsCaseData type(CaseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Cases resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseDataType getType() { + return type; + } + + public void setType(CaseDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateJiraIssueRequestDataRelationshipsCaseData + */ + @JsonAnySetter + public CreateJiraIssueRequestDataRelationshipsCaseData putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateJiraIssueRequestDataRelationshipsCaseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJiraIssueRequestDataRelationshipsCaseData + createJiraIssueRequestDataRelationshipsCaseData = + (CreateJiraIssueRequestDataRelationshipsCaseData) o; + return Objects.equals(this.id, createJiraIssueRequestDataRelationshipsCaseData.id) + && Objects.equals(this.type, createJiraIssueRequestDataRelationshipsCaseData.type) + && Objects.equals( + this.additionalProperties, + createJiraIssueRequestDataRelationshipsCaseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJiraIssueRequestDataRelationshipsCaseData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequest.java b/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequest.java new file mode 100644 index 00000000000..d9631c1b7b3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequest.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request for detaching security findings from their case. */ +@JsonPropertyOrder({DetachCaseRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DetachCaseRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DetachCaseRequestData data; + + public DetachCaseRequest data(DetachCaseRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for detaching security findings from their case. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DetachCaseRequestData getData() { + return data; + } + + public void setData(DetachCaseRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DetachCaseRequest + */ + @JsonAnySetter + public DetachCaseRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DetachCaseRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DetachCaseRequest detachCaseRequest = (DetachCaseRequest) o; + return Objects.equals(this.data, detachCaseRequest.data) + && Objects.equals(this.additionalProperties, detachCaseRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DetachCaseRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequestData.java b/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequestData.java new file mode 100644 index 00000000000..3e19945471e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequestData.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for detaching security findings from their case. */ +@JsonPropertyOrder({ + DetachCaseRequestData.JSON_PROPERTY_ID, + DetachCaseRequestData.JSON_PROPERTY_RELATIONSHIPS, + DetachCaseRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DetachCaseRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private DetachCaseRequestDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseDataType type = CaseDataType.CASES; + + public DetachCaseRequestData() {} + + @JsonCreator + public DetachCaseRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DetachCaseRequestData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the detachment request. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DetachCaseRequestData relationships(DetachCaseRequestDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships detaching security findings from their case. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DetachCaseRequestDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(DetachCaseRequestDataRelationships relationships) { + this.relationships = relationships; + } + + public DetachCaseRequestData type(CaseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Cases resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseDataType getType() { + return type; + } + + public void setType(CaseDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DetachCaseRequestData + */ + @JsonAnySetter + public DetachCaseRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DetachCaseRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DetachCaseRequestData detachCaseRequestData = (DetachCaseRequestData) o; + return Objects.equals(this.id, detachCaseRequestData.id) + && Objects.equals(this.relationships, detachCaseRequestData.relationships) + && Objects.equals(this.type, detachCaseRequestData.type) + && Objects.equals(this.additionalProperties, detachCaseRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DetachCaseRequestData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequestDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequestDataRelationships.java new file mode 100644 index 00000000000..ecb6f28ee4d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DetachCaseRequestDataRelationships.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships detaching security findings from their case. */ +@JsonPropertyOrder({DetachCaseRequestDataRelationships.JSON_PROPERTY_FINDINGS}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DetachCaseRequestDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FINDINGS = "findings"; + private Findings findings; + + public DetachCaseRequestDataRelationships() {} + + @JsonCreator + public DetachCaseRequestDataRelationships( + @JsonProperty(required = true, value = JSON_PROPERTY_FINDINGS) Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + } + + public DetachCaseRequestDataRelationships findings(Findings findings) { + this.findings = findings; + this.unparsed |= findings.unparsed; + return this; + } + + /** + * A list of security findings. + * + * @return findings + */ + @JsonProperty(JSON_PROPERTY_FINDINGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Findings getFindings() { + return findings; + } + + public void setFindings(Findings findings) { + this.findings = findings; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DetachCaseRequestDataRelationships + */ + @JsonAnySetter + public DetachCaseRequestDataRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DetachCaseRequestDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DetachCaseRequestDataRelationships detachCaseRequestDataRelationships = + (DetachCaseRequestDataRelationships) o; + return Objects.equals(this.findings, detachCaseRequestDataRelationships.findings) + && Objects.equals( + this.additionalProperties, detachCaseRequestDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(findings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DetachCaseRequestDataRelationships {\n"); + sb.append(" findings: ").append(toIndentedString(findings)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponse.java b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponse.java new file mode 100644 index 00000000000..3405cbd2ea4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponse.java @@ -0,0 +1,136 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Case response. */ +@JsonPropertyOrder({FindingCaseResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingCaseResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private FindingCaseResponseData data; + + public FindingCaseResponse data(FindingCaseResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the case. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FindingCaseResponseData getData() { + return data; + } + + public void setData(FindingCaseResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FindingCaseResponse + */ + @JsonAnySetter + public FindingCaseResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FindingCaseResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingCaseResponse findingCaseResponse = (FindingCaseResponse) o; + return Objects.equals(this.data, findingCaseResponse.data) + && Objects.equals(this.additionalProperties, findingCaseResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingCaseResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseArray.java b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseArray.java new file mode 100644 index 00000000000..0f3a6cda116 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseArray.java @@ -0,0 +1,155 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** List of case responses. */ +@JsonPropertyOrder({FindingCaseResponseArray.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingCaseResponseArray { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public FindingCaseResponseArray() {} + + @JsonCreator + public FindingCaseResponseArray( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public FindingCaseResponseArray data(List data) { + this.data = data; + for (FindingCaseResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FindingCaseResponseArray addDataItem(FindingCaseResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FindingCaseResponseArray + */ + @JsonAnySetter + public FindingCaseResponseArray putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FindingCaseResponseArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingCaseResponseArray findingCaseResponseArray = (FindingCaseResponseArray) o; + return Objects.equals(this.data, findingCaseResponseArray.data) + && Objects.equals(this.additionalProperties, findingCaseResponseArray.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingCaseResponseArray {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseData.java b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseData.java new file mode 100644 index 00000000000..e9ed5ee868f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseData.java @@ -0,0 +1,233 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data of the case. */ +@JsonPropertyOrder({ + FindingCaseResponseData.JSON_PROPERTY_ATTRIBUTES, + FindingCaseResponseData.JSON_PROPERTY_ID, + FindingCaseResponseData.JSON_PROPERTY_RELATIONSHIPS, + FindingCaseResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingCaseResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private FindingCaseResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private FindingCaseResponseDataRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private CaseDataType type = CaseDataType.CASES; + + public FindingCaseResponseData() {} + + @JsonCreator + public FindingCaseResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CaseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public FindingCaseResponseData attributes(FindingCaseResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the case. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FindingCaseResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(FindingCaseResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public FindingCaseResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the case. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public FindingCaseResponseData relationships(FindingCaseResponseDataRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the case. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FindingCaseResponseDataRelationships getRelationships() { + return relationships; + } + + public void setRelationships(FindingCaseResponseDataRelationships relationships) { + this.relationships = relationships; + } + + public FindingCaseResponseData type(CaseDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Cases resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CaseDataType getType() { + return type; + } + + public void setType(CaseDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FindingCaseResponseData + */ + @JsonAnySetter + public FindingCaseResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FindingCaseResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingCaseResponseData findingCaseResponseData = (FindingCaseResponseData) o; + return Objects.equals(this.attributes, findingCaseResponseData.attributes) + && Objects.equals(this.id, findingCaseResponseData.id) + && Objects.equals(this.relationships, findingCaseResponseData.relationships) + && Objects.equals(this.type, findingCaseResponseData.type) + && Objects.equals(this.additionalProperties, findingCaseResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingCaseResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataAttributes.java new file mode 100644 index 00000000000..49c4dc47b37 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataAttributes.java @@ -0,0 +1,643 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the case. */ +@JsonPropertyOrder({ + FindingCaseResponseDataAttributes.JSON_PROPERTY_ARCHIVED_AT, + FindingCaseResponseDataAttributes.JSON_PROPERTY_ASSIGNED_TO, + FindingCaseResponseDataAttributes.JSON_PROPERTY_ATTRIBUTES, + FindingCaseResponseDataAttributes.JSON_PROPERTY_CLOSED_AT, + FindingCaseResponseDataAttributes.JSON_PROPERTY_CREATED_AT, + FindingCaseResponseDataAttributes.JSON_PROPERTY_CREATION_SOURCE, + FindingCaseResponseDataAttributes.JSON_PROPERTY_DESCRIPTION, + FindingCaseResponseDataAttributes.JSON_PROPERTY_DUE_DATE, + FindingCaseResponseDataAttributes.JSON_PROPERTY_INSIGHTS, + FindingCaseResponseDataAttributes.JSON_PROPERTY_JIRA_ISSUE, + FindingCaseResponseDataAttributes.JSON_PROPERTY_KEY, + FindingCaseResponseDataAttributes.JSON_PROPERTY_MODIFIED_AT, + FindingCaseResponseDataAttributes.JSON_PROPERTY_PRIORITY, + FindingCaseResponseDataAttributes.JSON_PROPERTY_STATUS, + FindingCaseResponseDataAttributes.JSON_PROPERTY_STATUS_GROUP, + FindingCaseResponseDataAttributes.JSON_PROPERTY_STATUS_NAME, + FindingCaseResponseDataAttributes.JSON_PROPERTY_TITLE, + FindingCaseResponseDataAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingCaseResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ARCHIVED_AT = "archived_at"; + private OffsetDateTime archivedAt; + + public static final String JSON_PROPERTY_ASSIGNED_TO = "assigned_to"; + private RelationshipToUser assignedTo; + + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private Map> attributes = null; + + public static final String JSON_PROPERTY_CLOSED_AT = "closed_at"; + private OffsetDateTime closedAt; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CREATION_SOURCE = "creation_source"; + private String creationSource; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_DUE_DATE = "due_date"; + private String dueDate; + + public static final String JSON_PROPERTY_INSIGHTS = "insights"; + private List insights = null; + + public static final String JSON_PROPERTY_JIRA_ISSUE = "jira_issue"; + private FindingJiraIssue jiraIssue; + + public static final String JSON_PROPERTY_KEY = "key"; + private String key; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private OffsetDateTime modifiedAt; + + public static final String JSON_PROPERTY_PRIORITY = "priority"; + private String priority; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_STATUS_GROUP = "status_group"; + private String statusGroup; + + public static final String JSON_PROPERTY_STATUS_NAME = "status_name"; + private String statusName; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public FindingCaseResponseDataAttributes archivedAt(OffsetDateTime archivedAt) { + this.archivedAt = archivedAt; + return this; + } + + /** + * Timestamp of when the case was archived. + * + * @return archivedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARCHIVED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getArchivedAt() { + return archivedAt; + } + + public void setArchivedAt(OffsetDateTime archivedAt) { + this.archivedAt = archivedAt; + } + + public FindingCaseResponseDataAttributes assignedTo(RelationshipToUser assignedTo) { + this.assignedTo = assignedTo; + this.unparsed |= assignedTo.unparsed; + return this; + } + + /** + * Relationship to user. + * + * @return assignedTo + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNED_TO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUser getAssignedTo() { + return assignedTo; + } + + public void setAssignedTo(RelationshipToUser assignedTo) { + this.assignedTo = assignedTo; + } + + public FindingCaseResponseDataAttributes attributes(Map> attributes) { + this.attributes = attributes; + return this; + } + + public FindingCaseResponseDataAttributes putAttributesItem( + String key, List attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getAttributes() { + return attributes; + } + + public void setAttributes(Map> attributes) { + this.attributes = attributes; + } + + public FindingCaseResponseDataAttributes closedAt(OffsetDateTime closedAt) { + this.closedAt = closedAt; + return this; + } + + /** + * Timestamp of when the case was closed. + * + * @return closedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLOSED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getClosedAt() { + return closedAt; + } + + public void setClosedAt(OffsetDateTime closedAt) { + this.closedAt = closedAt; + } + + public FindingCaseResponseDataAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp of when the case was created. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public FindingCaseResponseDataAttributes creationSource(String creationSource) { + this.creationSource = creationSource; + return this; + } + + /** + * Source of the case creation. + * + * @return creationSource + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATION_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCreationSource() { + return creationSource; + } + + public void setCreationSource(String creationSource) { + this.creationSource = creationSource; + } + + public FindingCaseResponseDataAttributes description(String description) { + this.description = description; + return this; + } + + /** + * Description of the case. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public FindingCaseResponseDataAttributes dueDate(String dueDate) { + this.dueDate = dueDate; + return this; + } + + /** + * Due date of the case. + * + * @return dueDate + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DUE_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDueDate() { + return dueDate; + } + + public void setDueDate(String dueDate) { + this.dueDate = dueDate; + } + + public FindingCaseResponseDataAttributes insights(List insights) { + this.insights = insights; + for (CaseInsightsItems item : insights) { + this.unparsed |= item.unparsed; + } + return this; + } + + public FindingCaseResponseDataAttributes addInsightsItem(CaseInsightsItems insightsItem) { + if (this.insights == null) { + this.insights = new ArrayList<>(); + } + this.insights.add(insightsItem); + this.unparsed |= insightsItem.unparsed; + return this; + } + + /** + * Insights of the case. + * + * @return insights + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INSIGHTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInsights() { + return insights; + } + + public void setInsights(List insights) { + this.insights = insights; + } + + public FindingCaseResponseDataAttributes jiraIssue(FindingJiraIssue jiraIssue) { + this.jiraIssue = jiraIssue; + this.unparsed |= jiraIssue.unparsed; + return this; + } + + /** + * Jira issue associated with the case. + * + * @return jiraIssue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JIRA_ISSUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FindingJiraIssue getJiraIssue() { + return jiraIssue; + } + + public void setJiraIssue(FindingJiraIssue jiraIssue) { + this.jiraIssue = jiraIssue; + } + + public FindingCaseResponseDataAttributes key(String key) { + this.key = key; + return this; + } + + /** + * Key of the case. + * + * @return key + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public FindingCaseResponseDataAttributes modifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Timestamp of when the case was last modified. + * + * @return modifiedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(OffsetDateTime modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public FindingCaseResponseDataAttributes priority(String priority) { + this.priority = priority; + return this; + } + + /** + * Priority of the case. + * + * @return priority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPriority() { + return priority; + } + + public void setPriority(String priority) { + this.priority = priority; + } + + public FindingCaseResponseDataAttributes status(String status) { + this.status = status; + return this; + } + + /** + * Status of the case. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public FindingCaseResponseDataAttributes statusGroup(String statusGroup) { + this.statusGroup = statusGroup; + return this; + } + + /** + * Status group of the case. + * + * @return statusGroup + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS_GROUP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatusGroup() { + return statusGroup; + } + + public void setStatusGroup(String statusGroup) { + this.statusGroup = statusGroup; + } + + public FindingCaseResponseDataAttributes statusName(String statusName) { + this.statusName = statusName; + return this; + } + + /** + * Status name of the case. + * + * @return statusName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatusName() { + return statusName; + } + + public void setStatusName(String statusName) { + this.statusName = statusName; + } + + public FindingCaseResponseDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * Title of the case. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public FindingCaseResponseDataAttributes type(String type) { + this.type = type; + return this; + } + + /** + * Type of the case. For security cases, this is always "SECURITY". + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FindingCaseResponseDataAttributes + */ + @JsonAnySetter + public FindingCaseResponseDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FindingCaseResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingCaseResponseDataAttributes findingCaseResponseDataAttributes = + (FindingCaseResponseDataAttributes) o; + return Objects.equals(this.archivedAt, findingCaseResponseDataAttributes.archivedAt) + && Objects.equals(this.assignedTo, findingCaseResponseDataAttributes.assignedTo) + && Objects.equals(this.attributes, findingCaseResponseDataAttributes.attributes) + && Objects.equals(this.closedAt, findingCaseResponseDataAttributes.closedAt) + && Objects.equals(this.createdAt, findingCaseResponseDataAttributes.createdAt) + && Objects.equals(this.creationSource, findingCaseResponseDataAttributes.creationSource) + && Objects.equals(this.description, findingCaseResponseDataAttributes.description) + && Objects.equals(this.dueDate, findingCaseResponseDataAttributes.dueDate) + && Objects.equals(this.insights, findingCaseResponseDataAttributes.insights) + && Objects.equals(this.jiraIssue, findingCaseResponseDataAttributes.jiraIssue) + && Objects.equals(this.key, findingCaseResponseDataAttributes.key) + && Objects.equals(this.modifiedAt, findingCaseResponseDataAttributes.modifiedAt) + && Objects.equals(this.priority, findingCaseResponseDataAttributes.priority) + && Objects.equals(this.status, findingCaseResponseDataAttributes.status) + && Objects.equals(this.statusGroup, findingCaseResponseDataAttributes.statusGroup) + && Objects.equals(this.statusName, findingCaseResponseDataAttributes.statusName) + && Objects.equals(this.title, findingCaseResponseDataAttributes.title) + && Objects.equals(this.type, findingCaseResponseDataAttributes.type) + && Objects.equals( + this.additionalProperties, findingCaseResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + archivedAt, + assignedTo, + attributes, + closedAt, + createdAt, + creationSource, + description, + dueDate, + insights, + jiraIssue, + key, + modifiedAt, + priority, + status, + statusGroup, + statusName, + title, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingCaseResponseDataAttributes {\n"); + sb.append(" archivedAt: ").append(toIndentedString(archivedAt)).append("\n"); + sb.append(" assignedTo: ").append(toIndentedString(assignedTo)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" closedAt: ").append(toIndentedString(closedAt)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" creationSource: ").append(toIndentedString(creationSource)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" dueDate: ").append(toIndentedString(dueDate)).append("\n"); + sb.append(" insights: ").append(toIndentedString(insights)).append("\n"); + sb.append(" jiraIssue: ").append(toIndentedString(jiraIssue)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" statusGroup: ").append(toIndentedString(statusGroup)).append("\n"); + sb.append(" statusName: ").append(toIndentedString(statusName)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataRelationships.java b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataRelationships.java new file mode 100644 index 00000000000..19a903f0182 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingCaseResponseDataRelationships.java @@ -0,0 +1,196 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of the case. */ +@JsonPropertyOrder({ + FindingCaseResponseDataRelationships.JSON_PROPERTY_CREATED_BY, + FindingCaseResponseDataRelationships.JSON_PROPERTY_MODIFIED_BY, + FindingCaseResponseDataRelationships.JSON_PROPERTY_PROJECT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingCaseResponseDataRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private RelationshipToUser createdBy; + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private RelationshipToUser modifiedBy; + + public static final String JSON_PROPERTY_PROJECT = "project"; + private CaseManagementProject project; + + public FindingCaseResponseDataRelationships createdBy(RelationshipToUser createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * Relationship to user. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(RelationshipToUser createdBy) { + this.createdBy = createdBy; + } + + public FindingCaseResponseDataRelationships modifiedBy(RelationshipToUser modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * Relationship to user. + * + * @return modifiedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public RelationshipToUser getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(RelationshipToUser modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public FindingCaseResponseDataRelationships project(CaseManagementProject project) { + this.project = project; + this.unparsed |= project.unparsed; + return this; + } + + /** + * Case management project. + * + * @return project + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROJECT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CaseManagementProject getProject() { + return project; + } + + public void setProject(CaseManagementProject project) { + this.project = project; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FindingCaseResponseDataRelationships + */ + @JsonAnySetter + public FindingCaseResponseDataRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FindingCaseResponseDataRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingCaseResponseDataRelationships findingCaseResponseDataRelationships = + (FindingCaseResponseDataRelationships) o; + return Objects.equals(this.createdBy, findingCaseResponseDataRelationships.createdBy) + && Objects.equals(this.modifiedBy, findingCaseResponseDataRelationships.modifiedBy) + && Objects.equals(this.project, findingCaseResponseDataRelationships.project) + && Objects.equals( + this.additionalProperties, findingCaseResponseDataRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdBy, modifiedBy, project, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingCaseResponseDataRelationships {\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" project: ").append(toIndentedString(project)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingData.java b/src/main/java/com/datadog/api/client/v2/model/FindingData.java new file mode 100644 index 00000000000..5055d62f8e2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingData.java @@ -0,0 +1,175 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({FindingData.JSON_PROPERTY_ID, FindingData.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private FindingDataType type = FindingDataType.FINDINGS; + + public FindingData() {} + + @JsonCreator + public FindingData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) FindingDataType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public FindingData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the security finding. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public FindingData type(FindingDataType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Security findings resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public FindingDataType getType() { + return type; + } + + public void setType(FindingDataType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FindingData + */ + @JsonAnySetter + public FindingData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FindingData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingData findingData = (FindingData) o; + return Objects.equals(this.id, findingData.id) + && Objects.equals(this.type, findingData.type) + && Objects.equals(this.additionalProperties, findingData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingDataType.java b/src/main/java/com/datadog/api/client/v2/model/FindingDataType.java new file mode 100644 index 00000000000..1f2a5bc1ec0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingDataType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Security findings resource type. */ +@JsonSerialize(using = FindingDataType.FindingDataTypeSerializer.class) +public class FindingDataType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("findings")); + + public static final FindingDataType FINDINGS = new FindingDataType("findings"); + + FindingDataType(String value) { + super(value, allowedValues); + } + + public static class FindingDataTypeSerializer extends StdSerializer { + public FindingDataTypeSerializer(Class t) { + super(t); + } + + public FindingDataTypeSerializer() { + this(null); + } + + @Override + public void serialize(FindingDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static FindingDataType fromValue(String value) { + return new FindingDataType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssue.java b/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssue.java new file mode 100644 index 00000000000..a5e14f2af0a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssue.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Jira issue associated with the case. */ +@JsonPropertyOrder({ + FindingJiraIssue.JSON_PROPERTY_ERROR_MESSAGE, + FindingJiraIssue.JSON_PROPERTY_RESULT, + FindingJiraIssue.JSON_PROPERTY_STATUS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingJiraIssue { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ERROR_MESSAGE = "error_message"; + private String errorMessage; + + public static final String JSON_PROPERTY_RESULT = "result"; + private FindingJiraIssueResult result; + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public FindingJiraIssue errorMessage(String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * The error message if the Jira issue creation failed. + * + * @return errorMessage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ERROR_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public FindingJiraIssue result(FindingJiraIssueResult result) { + this.result = result; + this.unparsed |= result.unparsed; + return this; + } + + /** + * Result of the Jira issue creation. + * + * @return result + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESULT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public FindingJiraIssueResult getResult() { + return result; + } + + public void setResult(FindingJiraIssueResult result) { + this.result = result; + } + + public FindingJiraIssue status(String status) { + this.status = status; + return this; + } + + /** + * 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. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FindingJiraIssue + */ + @JsonAnySetter + public FindingJiraIssue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FindingJiraIssue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingJiraIssue findingJiraIssue = (FindingJiraIssue) o; + return Objects.equals(this.errorMessage, findingJiraIssue.errorMessage) + && Objects.equals(this.result, findingJiraIssue.result) + && Objects.equals(this.status, findingJiraIssue.status) + && Objects.equals(this.additionalProperties, findingJiraIssue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errorMessage, result, status, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingJiraIssue {\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" result: ").append(toIndentedString(result)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssueResult.java b/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssueResult.java new file mode 100644 index 00000000000..6728168b297 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/FindingJiraIssueResult.java @@ -0,0 +1,218 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Result of the Jira issue creation. */ +@JsonPropertyOrder({ + FindingJiraIssueResult.JSON_PROPERTY_ACCOUNT_ID, + FindingJiraIssueResult.JSON_PROPERTY_ISSUE_ID, + FindingJiraIssueResult.JSON_PROPERTY_ISSUE_KEY, + FindingJiraIssueResult.JSON_PROPERTY_ISSUE_URL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class FindingJiraIssueResult { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_ISSUE_ID = "issue_id"; + private String issueId; + + public static final String JSON_PROPERTY_ISSUE_KEY = "issue_key"; + private String issueKey; + + public static final String JSON_PROPERTY_ISSUE_URL = "issue_url"; + private String issueUrl; + + public FindingJiraIssueResult accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * The account ID of the Jira issue. + * + * @return accountId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAccountId() { + return accountId; + } + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + public FindingJiraIssueResult issueId(String issueId) { + this.issueId = issueId; + return this; + } + + /** + * The unique identifier of the Jira issue. + * + * @return issueId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueId() { + return issueId; + } + + public void setIssueId(String issueId) { + this.issueId = issueId; + } + + public FindingJiraIssueResult issueKey(String issueKey) { + this.issueKey = issueKey; + return this; + } + + /** + * The key of the Jira issue. + * + * @return issueKey + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_KEY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueKey() { + return issueKey; + } + + public void setIssueKey(String issueKey) { + this.issueKey = issueKey; + } + + public FindingJiraIssueResult issueUrl(String issueUrl) { + this.issueUrl = issueUrl; + return this; + } + + /** + * The URL of the Jira issue. + * + * @return issueUrl + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ISSUE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIssueUrl() { + return issueUrl; + } + + public void setIssueUrl(String issueUrl) { + this.issueUrl = issueUrl; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return FindingJiraIssueResult + */ + @JsonAnySetter + public FindingJiraIssueResult putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this FindingJiraIssueResult object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FindingJiraIssueResult findingJiraIssueResult = (FindingJiraIssueResult) o; + return Objects.equals(this.accountId, findingJiraIssueResult.accountId) + && Objects.equals(this.issueId, findingJiraIssueResult.issueId) + && Objects.equals(this.issueKey, findingJiraIssueResult.issueKey) + && Objects.equals(this.issueUrl, findingJiraIssueResult.issueUrl) + && Objects.equals(this.additionalProperties, findingJiraIssueResult.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, issueId, issueKey, issueUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FindingJiraIssueResult {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" issueId: ").append(toIndentedString(issueId)).append("\n"); + sb.append(" issueKey: ").append(toIndentedString(issueKey)).append("\n"); + sb.append(" issueUrl: ").append(toIndentedString(issueUrl)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Findings.java b/src/main/java/com/datadog/api/client/v2/model/Findings.java new file mode 100644 index 00000000000..d701c807599 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Findings.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** A list of security findings. */ +@JsonPropertyOrder({Findings.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Findings { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public Findings data(List data) { + this.data = data; + for (FindingData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public Findings addDataItem(FindingData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return Findings + */ + @JsonAnySetter + public Findings putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Findings object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Findings findings = (Findings) o; + return Objects.equals(this.data, findings.data) + && Objects.equals(this.additionalProperties, findings.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Findings {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/JiraIssuesDataType.java b/src/main/java/com/datadog/api/client/v2/model/JiraIssuesDataType.java new file mode 100644 index 00000000000..6a6ba2c0d86 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/JiraIssuesDataType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Jira issues resource type. */ +@JsonSerialize(using = JiraIssuesDataType.JiraIssuesDataTypeSerializer.class) +public class JiraIssuesDataType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("jira_issues")); + + public static final JiraIssuesDataType JIRA_ISSUES = new JiraIssuesDataType("jira_issues"); + + JiraIssuesDataType(String value) { + super(value, allowedValues); + } + + public static class JiraIssuesDataTypeSerializer extends StdSerializer { + public JiraIssuesDataTypeSerializer(Class t) { + super(t); + } + + public JiraIssuesDataTypeSerializer() { + this(null); + } + + @Override + public void serialize(JiraIssuesDataType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static JiraIssuesDataType fromValue(String value) { + return new JiraIssuesDataType(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_Jira_issue_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_Jira_issue_returns_OK_response.freeze new file mode 100644 index 00000000000..e21d532e446 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_Jira_issue_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-20T15:49:48.969Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_Jira_issue_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_Jira_issue_returns_OK_response.json new file mode 100644 index 00000000000..c80db7657b5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_Jira_issue_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "PATCH", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "264b8276-7e2a-d329-f00d-3c08be5edd45" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_case_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_case_returns_OK_response.freeze new file mode 100644 index 00000000000..24c38af62ef --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_case_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-19T16:20:46.726Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_case_returns_OK_response.json new file mode 100644 index 00000000000..5d1238ff279 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_finding_to_a_case_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"7d16945b-baf8-411e-ab2a-20fe43af1ea3\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f77253d6-b6e1-a15c-8bba-935f7487c98f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..7b6703448ac --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-20T15:53:19.037Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Bad_Request_response.json new file mode 100644 index 00000000000..71c6a8aefe0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "PATCH", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"no finding provided\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1a1598f7-b746-3b12-f967-f4fd38f0fa52" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..4495f3bf05a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-11-20T15:59:56.064Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Not_Found_response.json new file mode 100644 index 00000000000..ed90434243b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "PATCH", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"finding not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b1091cc9-c091-d172-0b0d-8b3f6e867c72" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_OK_response.freeze new file mode 100644 index 00000000000..8a74e023fa9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-20T15:52:21.664Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_OK_response.json new file mode 100644 index 00000000000..fbd3b83ee57 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_Jira_issue_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "PATCH", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d56c2c70-e68a-0484-4703-67cdb637611f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..1adeacaf476 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-19T16:16:38.781Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Bad_Request_response.json new file mode 100644 index 00000000000..bc8d7a3ed91 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"7d16945b-baf8-411e-ab2a-20fe43af1ea3\",\"relationships\":{\"findings\":{\"data\":[]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"no finding provided\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f7157864-476f-6c1c-361b-63ac95bdf478" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..ed7d98397fd --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-11-19T16:17:49.938Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Not_Found_response.json new file mode 100644 index 00000000000..f19f5a5f239 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"wrong-case-id\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/findings/cases/wrong-case-id", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"failed to get case: case not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fd2a19cd-b852-803c-07ea-e82a40bbfcbc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_OK_response.freeze new file mode 100644 index 00000000000..376033b3d93 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_OK_response.freeze @@ -0,0 +1 @@ +2025-11-19T16:23:42.957Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_OK_response.json new file mode 100644 index 00000000000..2655b134766 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Attach_security_findings_to_a_case_returns_OK_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"7d16945b-baf8-411e-ab2a-20fe43af1ea3\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"},{\"id\":\"MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fb0a6713-d4dd-bd8e-a8fe-bbb0f930458d" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze new file mode 100644 index 00000000000..6c188712b92 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-11-19T17:01:11.179Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json new file mode 100644 index 00000000000..a1c306f1804 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_finding_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "47444157-4365-2eb0-ec06-5e907eaf5d81" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"6a773295-8729-4034-aada-53b64cbe02e7\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d3dbab4a-5423-6df3-6069-407af8cb9daf" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze new file mode 100644 index 00000000000..8bb7a59bf99 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-11-21T14:49:30.001Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json new file mode 100644 index 00000000000..020af1e90dc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issue_for_security_findings_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "40dc36d3-aff0-7a0e-d962-e4dbbff80b14" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"e469ceda-957a-4557-a607-9ff25032e9ca\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "878b8060-40e9-b7da-0c6b-8c2abe8f6bc7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..ff98ffb1a13 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-20T12:01:47.295Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json new file mode 100644 index 00000000000..e3454666b2f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"no finding provided\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dfc86e15-f290-8c6c-3271-24698d3f3a50" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze new file mode 100644 index 00000000000..e5b6d0d76b3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-11-20T15:32:21.828Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json new file mode 100644 index 00000000000..0975be3a03b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "81f0f437-1280-de2c-7d8d-05c23337939e" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"53e242c6-a7d6-46ad-9680-b8d14753f716\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d15df31a-8725-9941-0c46-5c4c28433655" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..f0ed0dd3f18 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-11-20T15:42:51.100Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json new file mode 100644 index 00000000000..96b5e74ceb8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_Jira_issues_for_security_findings_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/security/findings/jira_issues", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"project not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f21ac686-77c1-ddb9-4c05-8bfdcaa7c533" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.freeze new file mode 100644 index 00000000000..a6ccca66ab5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-11-19T13:45:48.321Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.json new file mode 100644 index 00000000000..737ed5af083 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_case_for_security_finding_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "51c4e4e0-9193-1377-9424-e52cd6a52681" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"639c5df7-2352-4fc6-9d39-7dc8bdb8af14\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c7a2f33b-82d7-3106-eebc-42a4877be392" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.freeze new file mode 100644 index 00000000000..11d711428d3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-11-19T13:46:07.661Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.json new file mode 100644 index 00000000000..ae21eae372f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_case_for_security_findings_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d04ffa36-418b-582f-47ed-5b22a0b60827" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"2c1ac0c4-e8cf-4699-8781-09077b10d2a0\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c198d524-9355-a9d4-7ab2-13b40ab22dc1" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..03dcf162312 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-19T13:46:49.148Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Bad_Request_response.json new file mode 100644 index 00000000000..9135463743f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"attributes\":{},\"relationships\":{\"findings\":{\"data\":[]},\"project\":{\"data\":{\"id\":\"7f198869-c7ef-4afc-97cf-da5cdc13b5c3\",\"type\":\"projects\"}}},\"type\":\"cases\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"no finding provided\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "29bad7b9-7805-685f-1ae7-9b69cab3719f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.freeze b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.freeze new file mode 100644 index 00000000000..d1e05ac25c0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.freeze @@ -0,0 +1 @@ +2025-11-19T13:54:20.603Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.json new file mode 100644 index 00000000000..22b106488b6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Created_response.json @@ -0,0 +1,57 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"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": {}, + "method": "POST", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"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" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "196e43ee-c698-68cc-f6de-26033389542a" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"id\":\"7d16945b-baf8-411e-ab2a-20fe43af1ea3\",\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "11dbbde4-62ff-4a35-79f4-e6a53babed00" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..331897b6e2e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-11-19T13:47:19.797Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Not_Found_response.json new file mode 100644 index 00000000000..d5b17ef6e5d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_cases_for_security_findings_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"attributes\":{},\"relationships\":{\"findings\":{\"data\":[{\"id\":\"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=\",\"type\":\"findings\"}]},\"project\":{\"data\":{\"id\":\"00000000-0000-0000-0000-000000000000\",\"type\":\"projects\"}}},\"type\":\"cases\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"project not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fa1894af-1c5a-8cb9-bf7d-2aec7c5dd47b" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.freeze index d0f2e850f25..818d31b6df5 100644 --- a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:39.297Z \ No newline at end of file +2025-12-02T17:11:57.622Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.json index 898b56478cb..9a7364b9c53 100644 --- a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_Bad_Request_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentrulereturnsbadrequestresponse1764326919\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"64de7180-ffd3-417b-beb6-c6ea469b5b5f\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:39.863066Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentrulereturnsbadrequestresponse1764326919\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:39.863066Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"daadd697-95f4-4608-b6cc-8e6337d692ab\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:11:58.225449Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:11:58.225449Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "805bca15-e7f0-8cce-6b78-232a51416eb0" + "id": "70acb264-a190-c950-4530-585b68c408c5" }, { "httpRequest": { @@ -37,7 +37,7 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/64de7180-ffd3-417b-beb6-c6ea469b5b5f/rules", + "path": "/api/v2/deployment_gates/daadd697-95f4-4608-b6cc-8e6337d692ab/rules", "keepAlive": false, "secure": true }, @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "bc3a9ac9-1b37-41fd-cfbd-cbf054301e0a" + "id": "a16b8105-dc19-8442-190c-72d42b8c7473" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/64de7180-ffd3-417b-beb6-c6ea469b5b5f", + "path": "/api/v2/deployment_gates/daadd697-95f4-4608-b6cc-8e6337d692ab", "keepAlive": false, "secure": true }, @@ -78,6 +78,6 @@ "timeToLive": { "unlimited": true }, - "id": "8ed8a133-3531-e991-076e-d010c62eb341" + "id": "227b4564-ccc3-b0f7-2d53-fe1e4001c5be" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze index a342e74d959..f7669bb4b66 100644 --- a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:40.199Z \ No newline at end of file +2025-12-02T17:11:58.561Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json index e2d9971257c..7a6d6cc150b 100644 --- a/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_deployment_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentrulereturnsokresponse1764326920\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"2abe97e8-438e-410e-9630-185bd3634d4d\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:40.314903Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testcreatedeploymentrulereturnsokresponse1764326920\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:40.314903Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"b998ebca-01ad-4db8-96e6-a2beb54f497a\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:11:58.67035Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:11:58.67035Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "70d8a20e-daaf-6ee6-4c30-55d976ec6c9b" + "id": "70acb264-a190-c950-4530-585b68c408bf" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/2abe97e8-438e-410e-9630-185bd3634d4d/rules", + "path": "/api/v2/deployment_gates/b998ebca-01ad-4db8-96e6-a2beb54f497a/rules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"3370e167-8ad1-4cce-8efe-4688ff6d862e\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:40.464432Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"2abe97e8-438e-410e-9630-185bd3634d4d\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-11-28T10:48:40.464432Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"3feb569f-bb55-47cb-990f-7bc0c4c076f4\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-02T17:11:58.877828Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"b998ebca-01ad-4db8-96e6-a2beb54f497a\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-02T17:11:58.877828Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "a2fa7824-d779-a0d9-f15a-96378291fb9d" + "id": "858b1032-9845-1400-4077-7a2b2098be81" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/2abe97e8-438e-410e-9630-185bd3634d4d/rules/3370e167-8ad1-4cce-8efe-4688ff6d862e", + "path": "/api/v2/deployment_gates/b998ebca-01ad-4db8-96e6-a2beb54f497a/rules/3feb569f-bb55-47cb-990f-7bc0c4c076f4", "keepAlive": false, "secure": true }, @@ -78,13 +78,13 @@ "timeToLive": { "unlimited": true }, - "id": "a4030f93-8a6e-5599-6717-2e6d42bad0f3" + "id": "e7215262-d443-5d95-845d-ca7938047f4a" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/2abe97e8-438e-410e-9630-185bd3634d4d", + "path": "/api/v2/deployment_gates/b998ebca-01ad-4db8-96e6-a2beb54f497a", "keepAlive": false, "secure": true }, @@ -99,6 +99,6 @@ "timeToLive": { "unlimited": true }, - "id": "26b8761c-3065-9a6c-3f9b-9e3caf6a8ae1" + "id": "1840bf91-6f8a-d711-0454-74872823635f" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.freeze index c903e462ff2..6727b321fa1 100644 --- a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.freeze +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:40.779Z \ No newline at end of file +2025-12-02T17:11:59.228Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.json index 0d6d2f37aee..18fbab71ee0 100644 --- a/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_gate_returns_No_Content_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testdeletedeploymentgatereturnsnocontentresponse1764326920\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"86e38caf-0d2a-4e72-93ac-9850957d2c6b\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:40.909837Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testdeletedeploymentgatereturnsnocontentresponse1764326920\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:40.909837Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"0d6b54a5-70ad-4e9a-9ee4-f7d99f25a3d5\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:11:59.349857Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:11:59.349857Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,13 +27,13 @@ "timeToLive": { "unlimited": true }, - "id": "67a945a0-70d1-baa8-c7e5-b4f428bf52e0" + "id": "70acb264-a190-c950-4530-585b68c408c7" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/86e38caf-0d2a-4e72-93ac-9850957d2c6b", + "path": "/api/v2/deployment_gates/0d6b54a5-70ad-4e9a-9ee4-f7d99f25a3d5", "keepAlive": false, "secure": true }, @@ -48,13 +48,13 @@ "timeToLive": { "unlimited": true }, - "id": "3e123064-488b-434d-cd2d-e8d0c7cb4f34" + "id": "f64556f1-7830-ddbb-9db5-9662399ee781" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/86e38caf-0d2a-4e72-93ac-9850957d2c6b", + "path": "/api/v2/deployment_gates/0d6b54a5-70ad-4e9a-9ee4-f7d99f25a3d5", "keepAlive": false, "secure": true }, @@ -74,6 +74,6 @@ "timeToLive": { "unlimited": true }, - "id": "3e123064-488b-434d-cd2d-e8d0c7cb4f35" + "id": "f64556f1-7830-ddbb-9db5-9662399ee782" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.freeze index e0d912f1f64..5d67a9ba4b4 100644 --- a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.freeze +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:41.219Z \ No newline at end of file +2025-12-02T17:11:59.690Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.json index 7298f0659a0..8ad9bd9c6f7 100644 --- a/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_deployment_rule_returns_No_Content_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testdeletedeploymentrulereturnsnocontentresponse1764326921\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"32ff7c01-1f90-4ae4-bef0-b759f1ad280f\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:41.325741Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testdeletedeploymentrulereturnsnocontentresponse1764326921\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:41.325741Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"051490b0-1383-4dd4-b719-fb17ab089898\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:11:59.799293Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:11:59.799293Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "64f2a0d4-6a85-693f-0327-545fe7a0534b" + "id": "70acb264-a190-c950-4530-585b68c408c1" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/32ff7c01-1f90-4ae4-bef0-b759f1ad280f/rules", + "path": "/api/v2/deployment_gates/051490b0-1383-4dd4-b719-fb17ab089898/rules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"8229075f-8014-432c-9597-ba549ae5cd83\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:41.470358Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"32ff7c01-1f90-4ae4-bef0-b759f1ad280f\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-11-28T10:48:41.470358Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"29fb1e0d-d3f4-4f3a-a4de-1bd65cf57c16\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-02T17:11:59.98839Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"051490b0-1383-4dd4-b719-fb17ab089898\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-02T17:11:59.98839Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "459cdaaa-82d9-5680-601b-1a23b6a2c352" + "id": "6bd5203e-04e0-c90f-6f84-b04b848997cf" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/32ff7c01-1f90-4ae4-bef0-b759f1ad280f/rules/8229075f-8014-432c-9597-ba549ae5cd83", + "path": "/api/v2/deployment_gates/051490b0-1383-4dd4-b719-fb17ab089898/rules/29fb1e0d-d3f4-4f3a-a4de-1bd65cf57c16", "keepAlive": false, "secure": true }, @@ -78,13 +78,13 @@ "timeToLive": { "unlimited": true }, - "id": "03877ee6-c8bc-166d-4865-705e41312634" + "id": "c9a60e1f-d8e8-687e-20b6-65f7b1d70e11" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/32ff7c01-1f90-4ae4-bef0-b759f1ad280f/rules/8229075f-8014-432c-9597-ba549ae5cd83", + "path": "/api/v2/deployment_gates/051490b0-1383-4dd4-b719-fb17ab089898/rules/29fb1e0d-d3f4-4f3a-a4de-1bd65cf57c16", "keepAlive": false, "secure": true }, @@ -104,13 +104,13 @@ "timeToLive": { "unlimited": true }, - "id": "03877ee6-c8bc-166d-4865-705e41312635" + "id": "c9a60e1f-d8e8-687e-20b6-65f7b1d70e12" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/32ff7c01-1f90-4ae4-bef0-b759f1ad280f", + "path": "/api/v2/deployment_gates/051490b0-1383-4dd4-b719-fb17ab089898", "keepAlive": false, "secure": true }, @@ -125,6 +125,6 @@ "timeToLive": { "unlimited": true }, - "id": "2a6238b8-4294-9c96-4507-a7aa98426abc" + "id": "cfe2dedc-7956-91a6-0c99-f4ee245c8f38" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..48119112e5d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-11-20T16:07:27.292Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Bad_Request_response.json new file mode 100644 index 00000000000..328cbb246ab --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"findings\":{\"data\":[]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"no finding provided\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8867f3ab-a8dd-3d77-389d-7ce0a41008b2" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_No_Content_response.freeze b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_No_Content_response.freeze new file mode 100644 index 00000000000..3e388493c63 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_No_Content_response.freeze @@ -0,0 +1 @@ +2025-11-21T13:41:10.798Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_No_Content_response.json new file mode 100644 index 00000000000..088da41648c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_No_Content_response.json @@ -0,0 +1,27 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"findings\":{\"data\":[{\"id\":\"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "174509b6-8566-c668-aa99-a0da232e4fcb" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..72e1b275efe --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-11-20T16:06:53.415Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Not_Found_response.json new file mode 100644 index 00000000000..bd9cc1e0e7f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Detach_security_findings_from_their_case_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"relationships\":{\"findings\":{\"data\":[{\"id\":\"wrong-finding-id\",\"type\":\"findings\"}]}},\"type\":\"cases\"}}" + }, + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/cases", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"finding not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fb1bb6dc-156a-1af0-cfcf-6c91669ca655" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.freeze index 13cea2df227..a00e4ba26a8 100644 --- a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:41.902Z \ No newline at end of file +2025-12-02T17:12:00.422Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.json index fec61ff1695..0503308cb1f 100644 --- a/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_deployment_gate_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentgatereturnsokresponse1764326921\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"6fc0d64b-aa76-49f9-804b-5ba224951b53\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:42.011911Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentgatereturnsokresponse1764326921\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:42.011911Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"a71a41f7-e7b9-4c51-8af0-397c8e99aaf9\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:00.52354Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:12:00.52354Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,18 +27,18 @@ "timeToLive": { "unlimited": true }, - "id": "2ee257aa-1daf-56f9-8edd-6761ae9bdd50" + "id": "70acb264-a190-c950-4530-585b68c408c6" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/deployment_gates/6fc0d64b-aa76-49f9-804b-5ba224951b53", + "path": "/api/v2/deployment_gates/a71a41f7-e7b9-4c51-8af0-397c8e99aaf9", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"6fc0d64b-aa76-49f9-804b-5ba224951b53\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:42.011911Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentgatereturnsokresponse1764326921\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:42.011911Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"a71a41f7-e7b9-4c51-8af0-397c8e99aaf9\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:00.52354Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:12:00.52354Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -53,13 +53,13 @@ "timeToLive": { "unlimited": true }, - "id": "74d7566c-ab6a-8e98-c8b6-75d6475e1010" + "id": "7a1714b6-c4d9-89fa-0a6f-7c0023d67164" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/6fc0d64b-aa76-49f9-804b-5ba224951b53", + "path": "/api/v2/deployment_gates/a71a41f7-e7b9-4c51-8af0-397c8e99aaf9", "keepAlive": false, "secure": true }, @@ -74,6 +74,6 @@ "timeToLive": { "unlimited": true }, - "id": "a388cf9d-c776-cfee-96c4-8e7bb5d6ae5b" + "id": "b2ac5be2-bfad-4104-b212-2c28f0abe7ae" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.freeze index 3ae04f6f7ff..e00dc1eb2f1 100644 --- a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:42.334Z \ No newline at end of file +2025-12-02T17:12:00.864Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.json index dffb66390cc..6ac42251bbb 100644 --- a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_Bad_Request_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentrulereturnsbadrequestresponse1764326922\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"10bfb87d-3e15-4889-895c-28fd41d71837\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:42.440107Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentrulereturnsbadrequestresponse1764326922\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:42.440107Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"241e9292-911a-4eea-90e0-83b5f27a468c\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:00.969748Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:12:00.969748Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "8b774718-4108-3f1a-b4d0-bc37683f09ed" + "id": "70acb264-a190-c950-4530-585b68c408be" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/10bfb87d-3e15-4889-895c-28fd41d71837/rules", + "path": "/api/v2/deployment_gates/241e9292-911a-4eea-90e0-83b5f27a468c/rules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"e8c6d6c6-c529-4c30-92f9-8d965a68b120\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:42.588675Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"10bfb87d-3e15-4889-895c-28fd41d71837\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-11-28T10:48:42.588675Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"48d335e3-7744-4aef-af75-7c6d0bb9e24e\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:01.161979Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"241e9292-911a-4eea-90e0-83b5f27a468c\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-02T17:12:01.161979Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,7 +57,7 @@ "timeToLive": { "unlimited": true }, - "id": "3faa6627-bba0-f7aa-cc40-4ba107a049a2" + "id": "46c6cd47-c13b-157d-94b8-22aee9e7ae3c" }, { "httpRequest": { @@ -89,7 +89,7 @@ "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/10bfb87d-3e15-4889-895c-28fd41d71837/rules/e8c6d6c6-c529-4c30-92f9-8d965a68b120", + "path": "/api/v2/deployment_gates/241e9292-911a-4eea-90e0-83b5f27a468c/rules/48d335e3-7744-4aef-af75-7c6d0bb9e24e", "keepAlive": false, "secure": true }, @@ -104,13 +104,13 @@ "timeToLive": { "unlimited": true }, - "id": "fb4f8602-5f38-691c-7ffb-6117e71f7219" + "id": "9384928f-864c-0dbe-3913-5428e689b7d6" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/10bfb87d-3e15-4889-895c-28fd41d71837", + "path": "/api/v2/deployment_gates/241e9292-911a-4eea-90e0-83b5f27a468c", "keepAlive": false, "secure": true }, @@ -125,6 +125,6 @@ "timeToLive": { "unlimited": true }, - "id": "15673f07-ede6-25f9-982a-8d77f5604805" + "id": "6cc88ec8-1e87-3471-c71c-8dcc05d08e18" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze index dff9a2ed2ea..d03936e1d00 100644 --- a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:42.991Z \ No newline at end of file +2025-12-02T17:12:01.624Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json index ebc4e4d5759..72f13792d83 100644 --- a/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_deployment_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentrulereturnsokresponse1764326922\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"701d9655-8d81-43d0-9954-cf24b4959b60\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:43.092215Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testgetdeploymentrulereturnsokresponse1764326922\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:43.092215Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"defa04e5-9bb2-4a40-b854-1c2378ffcc58\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:01.70723Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:12:01.70723Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "242a5e37-735f-af90-61ac-e37f51523ec4" + "id": "70acb264-a190-c950-4530-585b68c408c2" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/701d9655-8d81-43d0-9954-cf24b4959b60/rules", + "path": "/api/v2/deployment_gates/defa04e5-9bb2-4a40-b854-1c2378ffcc58/rules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"c96cd32f-5c92-4bc7-9483-85a824b394a7\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:43.237862Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"701d9655-8d81-43d0-9954-cf24b4959b60\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-11-28T10:48:43.237862Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"c1009845-b7a4-4701-846b-df160891ab3d\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:01.871247Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"defa04e5-9bb2-4a40-b854-1c2378ffcc58\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-02T17:12:01.871247Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,18 +57,18 @@ "timeToLive": { "unlimited": true }, - "id": "29f4be06-bbc5-55c9-b970-5dd8735f48f9" + "id": "56de325f-f9cd-0433-e688-e48e07c5750b" }, { "httpRequest": { "headers": {}, "method": "GET", - "path": "/api/v2/deployment_gates/701d9655-8d81-43d0-9954-cf24b4959b60/rules/c96cd32f-5c92-4bc7-9483-85a824b394a7", + "path": "/api/v2/deployment_gates/defa04e5-9bb2-4a40-b854-1c2378ffcc58/rules/c1009845-b7a4-4701-846b-df160891ab3d", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"c96cd32f-5c92-4bc7-9483-85a824b394a7\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:43.237862Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"701d9655-8d81-43d0-9954-cf24b4959b60\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-11-28T10:48:43.237862Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"c1009845-b7a4-4701-846b-df160891ab3d\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:01.871247Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"defa04e5-9bb2-4a40-b854-1c2378ffcc58\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-02T17:12:01.871247Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -83,13 +83,13 @@ "timeToLive": { "unlimited": true }, - "id": "2221d4d1-1fbc-ffd5-fd60-ac9c4d1b23dd" + "id": "ac25de48-1d87-191f-4775-4920915c1ae3" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/701d9655-8d81-43d0-9954-cf24b4959b60/rules/c96cd32f-5c92-4bc7-9483-85a824b394a7", + "path": "/api/v2/deployment_gates/defa04e5-9bb2-4a40-b854-1c2378ffcc58/rules/c1009845-b7a4-4701-846b-df160891ab3d", "keepAlive": false, "secure": true }, @@ -104,13 +104,13 @@ "timeToLive": { "unlimited": true }, - "id": "4a3781c2-2e9f-afb1-fd05-a6da79f32abd" + "id": "d76616cf-2a97-5263-5b9d-5a90b190f24d" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/701d9655-8d81-43d0-9954-cf24b4959b60", + "path": "/api/v2/deployment_gates/defa04e5-9bb2-4a40-b854-1c2378ffcc58", "keepAlive": false, "secure": true }, @@ -125,6 +125,6 @@ "timeToLive": { "unlimited": true }, - "id": "a681b943-03e5-6689-c27e-5468daf6b0f3" + "id": "9b65b4bd-320f-a9f0-d8f2-96113a4ccca3" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.freeze index 72fa1316f44..363a2cef56e 100644 --- a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:43.738Z \ No newline at end of file +2025-12-02T17:12:02.280Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.json index 3dc457168e6..3268e8fe4fc 100644 --- a/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_deployment_gate_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentgatereturnsokresponse1764326923\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"6080b4ee-0fa6-4370-aafa-adb5b71c2fab\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:43.844073Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentgatereturnsokresponse1764326923\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:43.844073Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"010e234b-b358-463e-a44d-6fbe29ec3f6b\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:02.374479Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:12:02.374479Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0548f1b3-e5e1-61fc-86ca-af51fa14e18e" + "id": "70acb264-a190-c950-4530-585b68c408c0" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "PUT", - "path": "/api/v2/deployment_gates/6080b4ee-0fa6-4370-aafa-adb5b71c2fab", + "path": "/api/v2/deployment_gates/010e234b-b358-463e-a44d-6fbe29ec3f6b", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"6080b4ee-0fa6-4370-aafa-adb5b71c2fab\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:43.844073Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentgatereturnsokresponse1764326923\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:44.028502Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"010e234b-b358-463e-a44d-6fbe29ec3f6b\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:02.374479Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:12:02.534024Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,13 +57,13 @@ "timeToLive": { "unlimited": true }, - "id": "0f8e6b3d-0b71-b80d-c2ef-f6209ecc98b2" + "id": "78f3dddd-bd3f-cafd-d7f0-459709403df3" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/6080b4ee-0fa6-4370-aafa-adb5b71c2fab", + "path": "/api/v2/deployment_gates/010e234b-b358-463e-a44d-6fbe29ec3f6b", "keepAlive": false, "secure": true }, @@ -78,6 +78,6 @@ "timeToLive": { "unlimited": true }, - "id": "c62b2d45-1287-2929-a532-a1944e2e9f30" + "id": "0c4a6265-0194-294d-13cc-02cd7a727d3a" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.freeze index e708a507a68..742e9ca6042 100644 --- a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:44.227Z \ No newline at end of file +2025-12-02T17:12:02.719Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.json index 321dddd8392..c5929ce1c19 100644 --- a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_Bad_Request_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentrulereturnsbadrequestresponse1764326924\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"f7fc03e3-86d9-4731-9baf-9b3a2f9239c3\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:44.325367Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentrulereturnsbadrequestresponse1764326924\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:44.325367Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"ef2fa0b3-0f6a-49a4-9043-1d8130cb7361\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:02.81563Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:12:02.81563Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "6673fcb4-7218-e29c-910d-37b1db2b0e05" + "id": "70acb264-a190-c950-4530-585b68c408c4" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/f7fc03e3-86d9-4731-9baf-9b3a2f9239c3/rules", + "path": "/api/v2/deployment_gates/ef2fa0b3-0f6a-49a4-9043-1d8130cb7361/rules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"63e71fe3-f002-4e46-bc24-772c7a743e95\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:44.453112Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"f7fc03e3-86d9-4731-9baf-9b3a2f9239c3\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-11-28T10:48:44.453112Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"c89bf1d3-5e6a-43b1-9009-cfaaaddf8518\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:02.99992Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"ef2fa0b3-0f6a-49a4-9043-1d8130cb7361\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-02T17:12:02.99992Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,7 +57,7 @@ "timeToLive": { "unlimited": true }, - "id": "c3b1ad5a-c083-9195-9ae1-8c88d1a2402e" + "id": "f83da15c-7a67-dfdd-8dd0-752cd21dc851" }, { "httpRequest": { @@ -93,7 +93,7 @@ "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/f7fc03e3-86d9-4731-9baf-9b3a2f9239c3/rules/63e71fe3-f002-4e46-bc24-772c7a743e95", + "path": "/api/v2/deployment_gates/ef2fa0b3-0f6a-49a4-9043-1d8130cb7361/rules/c89bf1d3-5e6a-43b1-9009-cfaaaddf8518", "keepAlive": false, "secure": true }, @@ -108,13 +108,13 @@ "timeToLive": { "unlimited": true }, - "id": "4a0d7b50-5521-f81e-f78f-09278a52a46d" + "id": "e19d5544-ecf7-6158-1bfd-8cbb60d0e164" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/f7fc03e3-86d9-4731-9baf-9b3a2f9239c3", + "path": "/api/v2/deployment_gates/ef2fa0b3-0f6a-49a4-9043-1d8130cb7361", "keepAlive": false, "secure": true }, @@ -129,6 +129,6 @@ "timeToLive": { "unlimited": true }, - "id": "6cf68f13-2105-7d46-c507-7feedda73fac" + "id": "118fea1f-f206-8f73-3707-ca2bf9229e27" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze index 75b8801ebec..e8ff3a3f0e3 100644 --- a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.freeze @@ -1 +1 @@ -2025-11-28T10:48:44.855Z \ No newline at end of file +2025-12-02T17:12:03.436Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json index 995f16d3d56..fe9255c2d61 100644 --- a/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_deployment_rule_returns_OK_response.json @@ -3,7 +3,7 @@ "httpRequest": { "body": { "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentrulereturnsokresponse1764326924\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" + "json": "{\"data\":{\"attributes\":{\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\"},\"type\":\"deployment_gate\"}}" }, "headers": {}, "method": "POST", @@ -12,7 +12,7 @@ "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"b9fe1de0-ba29-4f86-abbb-09ec15047772\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:44.953026Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate-testupdatedeploymentrulereturnsokresponse1764326924\",\"service\":\"my-service\",\"updated_at\":\"2025-11-28T10:48:44.953026Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"bfdae182-ee23-493c-a90b-05441a76ad73\",\"type\":\"deployment_gate\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:03.529101Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"env\":\"production\",\"identifier\":\"my-gate\",\"service\":\"my-service\",\"updated_at\":\"2025-12-02T17:12:03.529101Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "1e7e74d6-e487-cecb-0dd1-aeccab1b7111" + "id": "70acb264-a190-c950-4530-585b68c408c3" }, { "httpRequest": { @@ -37,12 +37,12 @@ }, "headers": {}, "method": "POST", - "path": "/api/v2/deployment_gates/b9fe1de0-ba29-4f86-abbb-09ec15047772/rules", + "path": "/api/v2/deployment_gates/bfdae182-ee23-493c-a90b-05441a76ad73/rules", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"04207b55-28e1-46e6-9aa1-ed45dd022e3e\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:45.086885Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"b9fe1de0-ba29-4f86-abbb-09ec15047772\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-11-28T10:48:45.086885Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"93ed5e98-aeb8-4096-a035-0907f327019e\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:03.68857Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"bfdae182-ee23-493c-a90b-05441a76ad73\",\"name\":\"My deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-02T17:12:03.68857Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -57,7 +57,7 @@ "timeToLive": { "unlimited": true }, - "id": "b0126137-927e-4629-cf38-d776aee57722" + "id": "a39e041f-34ce-b6f9-492a-015e652dafb3" }, { "httpRequest": { @@ -67,12 +67,12 @@ }, "headers": {}, "method": "PUT", - "path": "/api/v2/deployment_gates/b9fe1de0-ba29-4f86-abbb-09ec15047772/rules/04207b55-28e1-46e6-9aa1-ed45dd022e3e", + "path": "/api/v2/deployment_gates/bfdae182-ee23-493c-a90b-05441a76ad73/rules/93ed5e98-aeb8-4096-a035-0907f327019e", "keepAlive": false, "secure": true }, "httpResponse": { - "body": "{\"data\":{\"id\":\"04207b55-28e1-46e6-9aa1-ed45dd022e3e\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-11-28T10:48:45.086885Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"b9fe1de0-ba29-4f86-abbb-09ec15047772\",\"name\":\"Updated deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-11-28T10:48:45.232653Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", + "body": "{\"data\":{\"id\":\"93ed5e98-aeb8-4096-a035-0907f327019e\",\"type\":\"deployment_rule\",\"attributes\":{\"created_at\":\"2025-12-02T17:12:03.68857Z\",\"created_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"},\"dry_run\":false,\"gate_id\":\"bfdae182-ee23-493c-a90b-05441a76ad73\",\"name\":\"Updated deployment rule\",\"options\":{},\"type\":\"faulty_deployment_detection\",\"updated_at\":\"2025-12-02T17:12:03.882016Z\",\"updated_by\":{\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\",\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\"}}}}", "headers": { "Content-Type": [ "application/vnd.api+json" @@ -87,13 +87,13 @@ "timeToLive": { "unlimited": true }, - "id": "4c42138e-9325-8e81-ecd3-6bc8be306431" + "id": "73db724b-34b9-23fb-9147-af57af849393" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/b9fe1de0-ba29-4f86-abbb-09ec15047772/rules/04207b55-28e1-46e6-9aa1-ed45dd022e3e", + "path": "/api/v2/deployment_gates/bfdae182-ee23-493c-a90b-05441a76ad73/rules/93ed5e98-aeb8-4096-a035-0907f327019e", "keepAlive": false, "secure": true }, @@ -108,13 +108,13 @@ "timeToLive": { "unlimited": true }, - "id": "5458cdb3-ae6f-2497-6faf-223be805b5b5" + "id": "bf7e48fc-9eed-3ef6-ca33-9f9dd223876f" }, { "httpRequest": { "headers": {}, "method": "DELETE", - "path": "/api/v2/deployment_gates/b9fe1de0-ba29-4f86-abbb-09ec15047772", + "path": "/api/v2/deployment_gates/bfdae182-ee23-493c-a90b-05441a76ad73", "keepAlive": false, "secure": true }, @@ -129,6 +129,6 @@ "timeToLive": { "unlimited": true }, - "id": "12c82fb6-c02d-f84f-cb70-002de7cba1cc" + "id": "cbada0b0-28a3-6291-c171-7d710fde6323" } ] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index d1d4bce2f10..6c6d3bf98f4 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -350,7 +350,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"type\": \"deployment_gate\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"my-gate-{{ unique_lower_alnum }}\",\n \"dry_run\": false\n }\n }\n}" + "value": "{\n \"data\": {\n \"type\": \"deployment_gate\",\n \"attributes\": {\n \"service\": \"my-service\",\n \"env\": \"production\",\n \"identifier\": \"my-gate\",\n \"dry_run\": false\n }\n }\n}" } ], "step": "there is a valid \"deployment_gate\" in the system", diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index 531c84c19c1..5599d509afc 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 7c226bf60d3..2e54bbe0afb 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -3670,6 +3670,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": {