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/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-Request-response.frozen index d0f2e850f25..818d31b6df5 100644 --- a/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-Request-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-Request-response.yml index 3b071a43e29..ff33aef5b99 100644 --- a/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-Bad-Request-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:39 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:57 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsbadrequestresponse1764326919","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,7 +23,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:39 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:57 GMT request: body: encoding: UTF-8 @@ -34,7 +34,7 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/64de7180-ffd3-417b-beb6-c6ea469b5b5f/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/daadd697-95f4-4608-b6cc-8e6337d692ab/rules response: body: encoding: UTF-8 @@ -46,14 +46,14 @@ http_interactions: status: code: 400 message: Bad Request -- recorded_at: Fri, 28 Nov 2025 10:48:39 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:57 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/64de7180-ffd3-417b-beb6-c6ea469b5b5f + uri: https://api.datadoghq.com/api/v2/deployment_gates/daadd697-95f4-4608-b6cc-8e6337d692ab response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-OK-response.frozen b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-OK-response.frozen index a342e74d959..f7669bb4b66 100644 --- a/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-OK-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-OK-response.yml b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-OK-response.yml index 16a26d2dceb..5b3dfbbe5b8 100644 --- a/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-OK-response.yml +++ b/cassettes/features/v2/deployment_gates/Create-deployment-rule-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:40 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:58 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testcreatedeploymentrulereturnsokresponse1764326920","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,7 +23,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:40 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:58 GMT request: body: encoding: UTF-8 @@ -34,13 +34,13 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/2abe97e8-438e-410e-9630-185bd3634d4d/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/b998ebca-01ad-4db8-96e6-a2beb54f497a/rules response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -48,14 +48,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:40 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:58 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/2abe97e8-438e-410e-9630-185bd3634d4d/rules/3370e167-8ad1-4cce-8efe-4688ff6d862e + uri: https://api.datadoghq.com/api/v2/deployment_gates/b998ebca-01ad-4db8-96e6-a2beb54f497a/rules/3feb569f-bb55-47cb-990f-7bc0c4c076f4 response: body: encoding: UTF-8 @@ -64,14 +64,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 28 Nov 2025 10:48:40 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:58 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/2abe97e8-438e-410e-9630-185bd3634d4d + uri: https://api.datadoghq.com/api/v2/deployment_gates/b998ebca-01ad-4db8-96e6-a2beb54f497a response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-No-Content-response.frozen b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-No-Content-response.frozen index c903e462ff2..6727b321fa1 100644 --- a/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-No-Content-response.frozen +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-No-Content-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-No-Content-response.yml b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-No-Content-response.yml index a49e9a390b6..f343882c87a 100644 --- a/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-No-Content-response.yml +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-gate-returns-No-Content-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:40 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:59 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testdeletedeploymentgatereturnsnocontentresponse1764326920","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,14 +23,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:40 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:59 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/86e38caf-0d2a-4e72-93ac-9850957d2c6b + uri: https://api.datadoghq.com/api/v2/deployment_gates/0d6b54a5-70ad-4e9a-9ee4-f7d99f25a3d5 response: body: encoding: UTF-8 @@ -39,14 +39,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 28 Nov 2025 10:48:40 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:59 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/86e38caf-0d2a-4e72-93ac-9850957d2c6b + uri: https://api.datadoghq.com/api/v2/deployment_gates/0d6b54a5-70ad-4e9a-9ee4-f7d99f25a3d5 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-No-Content-response.frozen b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-No-Content-response.frozen index e0d912f1f64..5d67a9ba4b4 100644 --- a/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-No-Content-response.frozen +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-No-Content-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-No-Content-response.yml b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-No-Content-response.yml index e0a4735c251..03d009de280 100644 --- a/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-No-Content-response.yml +++ b/cassettes/features/v2/deployment_gates/Delete-deployment-rule-returns-No-Content-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:41 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:59 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testdeletedeploymentrulereturnsnocontentresponse1764326921","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,7 +23,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:41 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:59 GMT request: body: encoding: UTF-8 @@ -34,13 +34,13 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/32ff7c01-1f90-4ae4-bef0-b759f1ad280f/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/051490b0-1383-4dd4-b719-fb17ab089898/rules response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -48,14 +48,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:41 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:59 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/32ff7c01-1f90-4ae4-bef0-b759f1ad280f/rules/8229075f-8014-432c-9597-ba549ae5cd83 + uri: https://api.datadoghq.com/api/v2/deployment_gates/051490b0-1383-4dd4-b719-fb17ab089898/rules/29fb1e0d-d3f4-4f3a-a4de-1bd65cf57c16 response: body: encoding: UTF-8 @@ -64,14 +64,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 28 Nov 2025 10:48:41 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:59 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/32ff7c01-1f90-4ae4-bef0-b759f1ad280f/rules/8229075f-8014-432c-9597-ba549ae5cd83 + uri: https://api.datadoghq.com/api/v2/deployment_gates/051490b0-1383-4dd4-b719-fb17ab089898/rules/29fb1e0d-d3f4-4f3a-a4de-1bd65cf57c16 response: body: encoding: UTF-8 @@ -83,14 +83,14 @@ http_interactions: status: code: 404 message: Not Found -- recorded_at: Fri, 28 Nov 2025 10:48:41 GMT +- recorded_at: Tue, 02 Dec 2025 17:11:59 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/32ff7c01-1f90-4ae4-bef0-b759f1ad280f + uri: https://api.datadoghq.com/api/v2/deployment_gates/051490b0-1383-4dd4-b719-fb17ab089898 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-OK-response.frozen b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-OK-response.frozen index 13cea2df227..a00e4ba26a8 100644 --- a/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-OK-response.frozen +++ b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-OK-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-OK-response.yml b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-OK-response.yml index cfccd875909..98e949eb509 100644 --- a/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-OK-response.yml +++ b/cassettes/features/v2/deployment_gates/Get-deployment-gate-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:41 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:00 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testgetdeploymentgatereturnsokresponse1764326921","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,19 +23,19 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:41 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:00 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/deployment_gates/6fc0d64b-aa76-49f9-804b-5ba224951b53 + uri: https://api.datadoghq.com/api/v2/deployment_gates/a71a41f7-e7b9-4c51-8af0-397c8e99aaf9 response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -43,14 +43,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:41 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:00 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/6fc0d64b-aa76-49f9-804b-5ba224951b53 + uri: https://api.datadoghq.com/api/v2/deployment_gates/a71a41f7-e7b9-4c51-8af0-397c8e99aaf9 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-Request-response.frozen index 3ae04f6f7ff..e00dc1eb2f1 100644 --- a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-Request-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-Request-response.yml index 1f9a5010c11..0ee889d0b68 100644 --- a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-Bad-Request-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:00 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testgetdeploymentrulereturnsbadrequestresponse1764326922","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,7 +23,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:00 GMT request: body: encoding: UTF-8 @@ -34,13 +34,13 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/10bfb87d-3e15-4889-895c-28fd41d71837/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/241e9292-911a-4eea-90e0-83b5f27a468c/rules response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -48,7 +48,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:00 GMT request: body: null headers: @@ -67,14 +67,14 @@ http_interactions: status: code: 400 message: Bad Request -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:00 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/10bfb87d-3e15-4889-895c-28fd41d71837/rules/e8c6d6c6-c529-4c30-92f9-8d965a68b120 + uri: https://api.datadoghq.com/api/v2/deployment_gates/241e9292-911a-4eea-90e0-83b5f27a468c/rules/48d335e3-7744-4aef-af75-7c6d0bb9e24e response: body: encoding: UTF-8 @@ -83,14 +83,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:00 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/10bfb87d-3e15-4889-895c-28fd41d71837 + uri: https://api.datadoghq.com/api/v2/deployment_gates/241e9292-911a-4eea-90e0-83b5f27a468c response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-OK-response.frozen b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-OK-response.frozen index dff9a2ed2ea..d03936e1d00 100644 --- a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-OK-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-OK-response.yml b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-OK-response.yml index bdc8b7e3a0c..3800099789e 100644 --- a/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-OK-response.yml +++ b/cassettes/features/v2/deployment_gates/Get-deployment-rule-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:01 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testgetdeploymentrulereturnsokresponse1764326922","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,7 +23,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:01 GMT request: body: encoding: UTF-8 @@ -34,13 +34,13 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/701d9655-8d81-43d0-9954-cf24b4959b60/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/defa04e5-9bb2-4a40-b854-1c2378ffcc58/rules response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -48,20 +48,20 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:01 GMT request: body: null headers: Accept: - application/json method: GET - uri: https://api.datadoghq.com/api/v2/deployment_gates/701d9655-8d81-43d0-9954-cf24b4959b60/rules/c96cd32f-5c92-4bc7-9483-85a824b394a7 + uri: https://api.datadoghq.com/api/v2/deployment_gates/defa04e5-9bb2-4a40-b854-1c2378ffcc58/rules/c1009845-b7a4-4701-846b-df160891ab3d response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -69,14 +69,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:01 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/701d9655-8d81-43d0-9954-cf24b4959b60/rules/c96cd32f-5c92-4bc7-9483-85a824b394a7 + uri: https://api.datadoghq.com/api/v2/deployment_gates/defa04e5-9bb2-4a40-b854-1c2378ffcc58/rules/c1009845-b7a4-4701-846b-df160891ab3d response: body: encoding: UTF-8 @@ -85,14 +85,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 28 Nov 2025 10:48:42 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:01 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/701d9655-8d81-43d0-9954-cf24b4959b60 + uri: https://api.datadoghq.com/api/v2/deployment_gates/defa04e5-9bb2-4a40-b854-1c2378ffcc58 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-OK-response.frozen b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-OK-response.frozen index 72fa1316f44..363a2cef56e 100644 --- a/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-OK-response.frozen +++ b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-OK-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-OK-response.yml b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-OK-response.yml index 72bd31fdcce..5839fc1317e 100644 --- a/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-OK-response.yml +++ b/cassettes/features/v2/deployment_gates/Update-deployment-gate-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:43 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:02 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testupdatedeploymentgatereturnsokresponse1764326923","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,7 +23,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:43 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:02 GMT request: body: encoding: UTF-8 @@ -34,12 +34,12 @@ http_interactions: Content-Type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v2/deployment_gates/6080b4ee-0fa6-4370-aafa-adb5b71c2fab + uri: https://api.datadoghq.com/api/v2/deployment_gates/010e234b-b358-463e-a44d-6fbe29ec3f6b response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -47,14 +47,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:43 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:02 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/6080b4ee-0fa6-4370-aafa-adb5b71c2fab + uri: https://api.datadoghq.com/api/v2/deployment_gates/010e234b-b358-463e-a44d-6fbe29ec3f6b response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-Request-response.frozen index e708a507a68..742e9ca6042 100644 --- a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-Request-response.frozen +++ b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-Request-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-Request-response.yml index 02486d3c702..f004f4a51ea 100644 --- a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-Request-response.yml +++ b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-Bad-Request-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:02 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testupdatedeploymentrulereturnsbadrequestresponse1764326924","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,7 +23,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:02 GMT request: body: encoding: UTF-8 @@ -34,13 +34,13 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/f7fc03e3-86d9-4731-9baf-9b3a2f9239c3/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/ef2fa0b3-0f6a-49a4-9043-1d8130cb7361/rules response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -48,7 +48,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:02 GMT request: body: encoding: UTF-8 @@ -71,14 +71,14 @@ http_interactions: status: code: 400 message: Bad Request -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:02 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/f7fc03e3-86d9-4731-9baf-9b3a2f9239c3/rules/63e71fe3-f002-4e46-bc24-772c7a743e95 + uri: https://api.datadoghq.com/api/v2/deployment_gates/ef2fa0b3-0f6a-49a4-9043-1d8130cb7361/rules/c89bf1d3-5e6a-43b1-9009-cfaaaddf8518 response: body: encoding: UTF-8 @@ -87,14 +87,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:02 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/f7fc03e3-86d9-4731-9baf-9b3a2f9239c3 + uri: https://api.datadoghq.com/api/v2/deployment_gates/ef2fa0b3-0f6a-49a4-9043-1d8130cb7361 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-OK-response.frozen b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-OK-response.frozen index 75b8801ebec..e8ff3a3f0e3 100644 --- a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-OK-response.frozen +++ b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-OK-response.frozen @@ -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/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-OK-response.yml b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-OK-response.yml index 98c7f7122d0..c7676c8874d 100644 --- a/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-OK-response.yml +++ b/cassettes/features/v2/deployment_gates/Update-deployment-rule-returns-OK-response.yml @@ -1,9 +1,9 @@ http_interactions: -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:03 GMT request: body: encoding: UTF-8 - string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate-testupdatedeploymentrulereturnsokresponse1764326924","service":"my-service"},"type":"deployment_gate"}}' + string: '{"data":{"attributes":{"dry_run":false,"env":"production","identifier":"my-gate","service":"my-service"},"type":"deployment_gate"}}' headers: Accept: - application/json @@ -14,8 +14,8 @@ http_interactions: response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -23,7 +23,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:03 GMT request: body: encoding: UTF-8 @@ -34,13 +34,13 @@ http_interactions: Content-Type: - application/json method: POST - uri: https://api.datadoghq.com/api/v2/deployment_gates/b9fe1de0-ba29-4f86-abbb-09ec15047772/rules + uri: https://api.datadoghq.com/api/v2/deployment_gates/bfdae182-ee23-493c-a90b-05441a76ad73/rules response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -48,7 +48,7 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:03 GMT request: body: encoding: UTF-8 @@ -59,13 +59,13 @@ http_interactions: Content-Type: - application/json method: PUT - uri: https://api.datadoghq.com/api/v2/deployment_gates/b9fe1de0-ba29-4f86-abbb-09ec15047772/rules/04207b55-28e1-46e6-9aa1-ed45dd022e3e + uri: https://api.datadoghq.com/api/v2/deployment_gates/bfdae182-ee23-493c-a90b-05441a76ad73/rules/93ed5e98-aeb8-4096-a035-0907f327019e response: body: encoding: UTF-8 - string: '{"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 + string: '{"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: @@ -73,14 +73,14 @@ http_interactions: status: code: 200 message: OK -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:03 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/b9fe1de0-ba29-4f86-abbb-09ec15047772/rules/04207b55-28e1-46e6-9aa1-ed45dd022e3e + uri: https://api.datadoghq.com/api/v2/deployment_gates/bfdae182-ee23-493c-a90b-05441a76ad73/rules/93ed5e98-aeb8-4096-a035-0907f327019e response: body: encoding: UTF-8 @@ -89,14 +89,14 @@ http_interactions: status: code: 204 message: No Content -- recorded_at: Fri, 28 Nov 2025 10:48:44 GMT +- recorded_at: Tue, 02 Dec 2025 17:12:03 GMT request: body: null headers: Accept: - '*/*' method: DELETE - uri: https://api.datadoghq.com/api/v2/deployment_gates/b9fe1de0-ba29-4f86-abbb-09ec15047772 + uri: https://api.datadoghq.com/api/v2/deployment_gates/bfdae182-ee23-493c-a90b-05441a76ad73 response: body: encoding: UTF-8 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.frozen new file mode 100644 index 00000000000..e21d532e446 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:49:48.969Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.yml new file mode 100644 index 00000000000..61f20be83b5 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-Jira-issue-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:49:48 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9efb1118-ed9c-4b02-b13b-f3acf8415f7c","type":"cases","attributes":{"created_at":"2025-11-20T15:22:44.644286Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static","resource_id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404808","issue_key":"CSMSEC-105476","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-463","modified_at":"2025-11-20T15:49:53.272293Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.frozen new file mode 100644 index 00000000000..24c38af62ef --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-19T16:20:46.726Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.yml new file mode 100644 index 00000000000..340e3ca1375 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-finding-to-a-case-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 16:20:46 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634063Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-459","modified_at":"2025-11-19T16:20:51.754979Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.frozen new file mode 100644 index 00000000000..7b6703448ac --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:53:19.037Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.yml new file mode 100644 index 00000000000..07d0e2ab6b8 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:53:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.frozen new file mode 100644 index 00000000000..4495f3bf05a --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:59:56.064Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.yml new file mode 100644 index 00000000000..4d48ce4779f --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:59:56 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[{"id":"wrong-finding-id","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"finding not + found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.frozen new file mode 100644 index 00000000000..8a74e023fa9 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:52:21.664Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.yml new file mode 100644 index 00000000000..b5c5aa89855 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-Jira-issue-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:52:21 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"jira_issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"},"relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"},{"id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9efb1118-ed9c-4b02-b13b-f3acf8415f7c","type":"cases","attributes":{"created_at":"2025-11-20T15:22:44.644286Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static","resource_id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/13c7ffac3021be5d1bd4c5e07b575fca?detection=static","resource_id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404808","issue_key":"CSMSEC-105476","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-463","modified_at":"2025-11-20T15:52:25.368628Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.frozen new file mode 100644 index 00000000000..1adeacaf476 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-19T16:16:38.781Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.yml new file mode 100644 index 00000000000..706e023b362 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 16:16:38 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[]}},"type":"cases"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.frozen new file mode 100644 index 00000000000..ed7d98397fd --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-19T16:17:49.938Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.yml new file mode 100644 index 00000000000..3deb34f3ef4 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 16:17:49 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"wrong-case-id","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/wrong-case-id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"failed to + get case: case not found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.frozen b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.frozen new file mode 100644 index 00000000000..376033b3d93 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.frozen @@ -0,0 +1 @@ +2025-11-19T16:23:42.957Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.yml b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.yml new file mode 100644 index 00000000000..99e64134f1f --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Attach-security-findings-to-a-case-returns-OK-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 16:23:42 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"},{"id":"MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/findings/cases/7d16945b-baf8-411e-ab2a-20fe43af1ea3 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634063Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static","resource_id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/2e336d846a2745499849778d969b56f8?detection=static","resource_id":"MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ="}],"key":"CSMINV-459","modified_at":"2025-11-19T16:23:22.109092Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"modified_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.frozen new file mode 100644 index 00000000000..6c188712b92 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-19T17:01:11.179Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.yml new file mode 100644 index 00000000000..778a2ce2369 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-finding-returns-Created-response.yml @@ -0,0 +1,47 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 17:01:11 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"6a773295-8729-4034-aada-53b64cbe02e7","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"6a773295-8729-4034-aada-53b64cbe02e7","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"},{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"6a773295-8729-4034-aada-53b64cbe02e7","type":"cases","attributes":{"created_at":"2025-11-19T17:01:15.21452Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2402037","issue_key":"CSMSEC-105473","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105473","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-461","modified_at":"2025-11-19T17:01:16.621974Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 19 Nov 2025 17:01:11 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"6a773295-8729-4034-aada-53b64cbe02e7","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.frozen new file mode 100644 index 00000000000..8bb7a59bf99 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-21T14:49:30.001Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.yml new file mode 100644 index 00000000000..3f20ab01173 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issue-for-security-findings-returns-Created-response.yml @@ -0,0 +1,47 @@ +http_interactions: +- recorded_at: Fri, 21 Nov 2025 14:49:30 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"e469ceda-957a-4557-a607-9ff25032e9ca","relationships":{"findings":{"data":[{"id":"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"},{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"},{"id":"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"},{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","type":"cases","attributes":{"created_at":"2025-11-21T14:49:32.034826Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/f16db9b7fa42c8a047777b354d6ccfe7?detection=static","resource_id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/3510289f2aa284ab44f86b66e1f64cc7?detection=static","resource_id":"MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2407744","issue_key":"CSMSEC-105481","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105481","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-468","modified_at":"2025-11-21T14:49:33.306003Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 21 Nov 2025 14:49:30 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"e469ceda-957a-4557-a607-9ff25032e9ca","relationships":{"findings":{"data":[{"id":"ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.frozen new file mode 100644 index 00000000000..ff98ffb1a13 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-20T12:01:47.295Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.yml new file mode 100644 index 00000000000..2a68f07664e --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 12:01:47 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"a7c38bab-ae98-4113-878c-c98799f914c2","type":"cases"}}},"type":"jira_issues"}],"included":[{"id":"a7c38bab-ae98-4113-878c-c98799f914c2","relationships":{"findings":{"data":[]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.frozen new file mode 100644 index 00000000000..e5b6d0d76b3 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:32:21.828Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.yml new file mode 100644 index 00000000000..010a8f7eba6 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Created-response.yml @@ -0,0 +1,50 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:32:21 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","type":"cases"}}},"type":"jira_issues"},{"attributes":{},"relationships":{"case":{"data":{"id":"195772b2-1f53-41d2-b81e-48c8e6c21d33","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"attributes":{"description":"A + description","title":"A title"},"id":"195772b2-1f53-41d2-b81e-48c8e6c21d33","relationships":{"findings":{"data":[{"id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"},{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"},{"id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=","type":"findings"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","type":"cases","attributes":{"created_at":"2025-11-20T15:32:23.777159Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/94762d2f0123331575cd81095e450f09?detection=static","resource_id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404837","issue_key":"CSMSEC-105480","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105480","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-467","modified_at":"2025-11-20T15:32:25.088199Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}},{"id":"195772b2-1f53-41d2-b81e-48c8e6c21d33","type":"cases","attributes":{"created_at":"2025-11-20T15:32:23.776904Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/13c7ffac3021be5d1bd4c5e07b575fca?detection=static","resource_id":"MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2404836","issue_key":"CSMSEC-105479","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105479","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-466","modified_at":"2025-11-20T15:32:24.96456Z","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 20 Nov 2025 15:32:21 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"53e242c6-a7d6-46ad-9680-b8d14753f716","relationships":{"findings":{"data":[{"id":"OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.frozen new file mode 100644 index 00000000000..f0ed0dd3f18 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-20T15:42:51.100Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.yml new file mode 100644 index 00000000000..5595d0faa09 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-Jira-issues-for-security-findings-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 15:42:51 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"case":{"data":{"id":"6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3","type":"cases"}}},"type":"jira_issues"}],"included":[{"attributes":{"description":"A + description","title":"A title"},"id":"6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3","relationships":{"findings":{"data":[{"id":"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=","type":"findings"}]},"project":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"projects"}}},"type":"cases"},{"id":"00000000-0000-0000-0000-000000000000","type":"projects"},{"id":"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=","type":"findings"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"project not + found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.frozen new file mode 100644 index 00000000000..a6ccca66ab5 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:45:48.321Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.yml new file mode 100644 index 00000000000..5faeadee24a --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-case-for-security-finding-returns-Created-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:45:48 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"639c5df7-2352-4fc6-9d39-7dc8bdb8af14","type":"cases","attributes":{"created_at":"2025-11-19T13:45:50.295906Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-454","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 19 Nov 2025 13:45:48 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"639c5df7-2352-4fc6-9d39-7dc8bdb8af14","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.frozen new file mode 100644 index 00000000000..11d711428d3 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:46:07.661Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.yml new file mode 100644 index 00000000000..76df2324d89 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-case-for-security-findings-returns-Created-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:46:07 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"},{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"2c1ac0c4-e8cf-4699-8781-09077b10d2a0","type":"cases","attributes":{"created_at":"2025-11-19T13:46:09.874194Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static","resource_id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU="},{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-455","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 19 Nov 2025 13:46:07 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"2c1ac0c4-e8cf-4699-8781-09077b10d2a0","relationships":{"findings":{"data":[{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.frozen new file mode 100644 index 00000000000..03dcf162312 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:46:49.148Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.yml new file mode 100644 index 00000000000..1a6534ef8e1 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:46:49 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"findings":{"data":[]},"project":{"data":{"id":"7f198869-c7ef-4afc-97cf-da5cdc13b5c3","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.frozen b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.frozen new file mode 100644 index 00000000000..d1e05ac25c0 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:54:20.603Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.yml b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.yml new file mode 100644 index 00000000000..a9d014a2713 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Created-response.yml @@ -0,0 +1,49 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:54:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"},{"attributes":{"description":"A + description","title":"A title"},"relationships":{"findings":{"data":[{"id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634063Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/dfa027f7c037b2f77159adc027fecb56?detection=static","resource_id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}],"key":"CSMINV-459","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}},{"id":"601cab78-ef04-4bdf-901a-55533afbde0b","type":"cases","attributes":{"created_at":"2025-11-19T13:54:23.634552Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/appsec/vm/library/vulnerability/36d53183f8fefbbc2208878f3d2011f0?detection=static","resource_id":"MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU="}],"key":"CSMINV-458","priority":"NOT_DEFINED","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Wed, 19 Nov 2025 13:54:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"id":"7d16945b-baf8-411e-ab2a-20fe43af1ea3","relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.frozen new file mode 100644 index 00000000000..331897b6e2e --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-19T13:47:19.797Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.yml new file mode 100644 index 00000000000..1c0b051c4f7 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-cases-for-security-findings-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Wed, 19 Nov 2025 13:47:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"projects"}}},"type":"cases"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"project not + found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.frozen new file mode 100644 index 00000000000..48119112e5d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-11-20T16:07:27.292Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.yml new file mode 100644 index 00000000000..621160572bd --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 16:07:27 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"findings":{"data":[]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding + provided"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.frozen b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.frozen new file mode 100644 index 00000000000..3e388493c63 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2025-11-21T13:41:10.798Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.yml b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.yml new file mode 100644 index 00000000000..23d7921f127 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-No-Content-response.yml @@ -0,0 +1,22 @@ +http_interactions: +- recorded_at: Fri, 21 Nov 2025 13:41:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"findings":{"data":[{"id":"YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.frozen new file mode 100644 index 00000000000..72e1b275efe --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-11-20T16:06:53.415Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.yml new file mode 100644 index 00000000000..749a69c7ac4 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Detach-security-findings-from-their-case-returns-Not-Found-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Thu, 20 Nov 2025 16:06:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"relationships":{"findings":{"data":[{"id":"wrong-finding-id","type":"findings"}]}},"type":"cases"}}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"finding not + found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/examples/v2/security-monitoring/AttachCase.rb b/examples/v2/security-monitoring/AttachCase.rb new file mode 100644 index 00000000000..860653be0ef --- /dev/null +++ b/examples/v2/security-monitoring/AttachCase.rb @@ -0,0 +1,26 @@ +# Attach security findings to a case returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AttachCaseRequest.new({ + data: DatadogAPIClient::V2::AttachCaseRequestData.new({ + id: "7d16945b-baf8-411e-ab2a-20fe43af1ea3", + relationships: DatadogAPIClient::V2::AttachCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + DatadogAPIClient::V2::FindingData.new({ + id: "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), +}) +p api_instance.attach_case("7d16945b-baf8-411e-ab2a-20fe43af1ea3", body) diff --git a/examples/v2/security-monitoring/AttachCase_897782765.rb b/examples/v2/security-monitoring/AttachCase_897782765.rb new file mode 100644 index 00000000000..34f9e1bfecc --- /dev/null +++ b/examples/v2/security-monitoring/AttachCase_897782765.rb @@ -0,0 +1,22 @@ +# Attach security finding to a case returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AttachCaseRequest.new({ + data: DatadogAPIClient::V2::AttachCaseRequestData.new({ + id: "7d16945b-baf8-411e-ab2a-20fe43af1ea3", + relationships: DatadogAPIClient::V2::AttachCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), +}) +p api_instance.attach_case("7d16945b-baf8-411e-ab2a-20fe43af1ea3", body) diff --git a/examples/v2/security-monitoring/AttachJiraIssue.rb b/examples/v2/security-monitoring/AttachJiraIssue.rb new file mode 100644 index 00000000000..a44840d6b63 --- /dev/null +++ b/examples/v2/security-monitoring/AttachJiraIssue.rb @@ -0,0 +1,34 @@ +# Attach security findings to a Jira issue returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AttachJiraIssueRequest.new({ + data: DatadogAPIClient::V2::AttachJiraIssueRequestData.new({ + attributes: DatadogAPIClient::V2::AttachJiraIssueRequestDataAttributes.new({ + jira_issue_url: "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476", + }), + relationships: DatadogAPIClient::V2::AttachJiraIssueRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + DatadogAPIClient::V2::FindingData.new({ + id: "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + }), +}) +p api_instance.attach_jira_issue(body) diff --git a/examples/v2/security-monitoring/AttachJiraIssue_3042842144.rb b/examples/v2/security-monitoring/AttachJiraIssue_3042842144.rb new file mode 100644 index 00000000000..15d65393039 --- /dev/null +++ b/examples/v2/security-monitoring/AttachJiraIssue_3042842144.rb @@ -0,0 +1,30 @@ +# Attach security finding to a Jira issue returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AttachJiraIssueRequest.new({ + data: DatadogAPIClient::V2::AttachJiraIssueRequestData.new({ + attributes: DatadogAPIClient::V2::AttachJiraIssueRequestDataAttributes.new({ + jira_issue_url: "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476", + }), + relationships: DatadogAPIClient::V2::AttachJiraIssueRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + }), +}) +p api_instance.attach_jira_issue(body) diff --git a/examples/v2/security-monitoring/CreateCases.rb b/examples/v2/security-monitoring/CreateCases.rb new file mode 100644 index 00000000000..dd27ba42195 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases.rb @@ -0,0 +1,56 @@ +# Create cases for security findings returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateCaseRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), + DatadogAPIClient::V2::CreateCaseRequestData.new({ + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), + ], +}) +p api_instance.create_cases(body) diff --git a/examples/v2/security-monitoring/CreateCases_2385516013.rb b/examples/v2/security-monitoring/CreateCases_2385516013.rb new file mode 100644 index 00000000000..eed17aefff9 --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases_2385516013.rb @@ -0,0 +1,33 @@ +# Create case for security finding returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateCaseRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), + ], +}) +p api_instance.create_cases(body) diff --git a/examples/v2/security-monitoring/CreateCases_2798851680.rb b/examples/v2/security-monitoring/CreateCases_2798851680.rb new file mode 100644 index 00000000000..4e15675d31e --- /dev/null +++ b/examples/v2/security-monitoring/CreateCases_2798851680.rb @@ -0,0 +1,37 @@ +# Create case for security findings returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateCaseRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + DatadogAPIClient::V2::FindingData.new({ + id: "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + }), + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), + ], +}) +p api_instance.create_cases(body) diff --git a/examples/v2/security-monitoring/CreateJiraIssues.rb b/examples/v2/security-monitoring/CreateJiraIssues.rb new file mode 100644 index 00000000000..eb5188b1f5d --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues.rb @@ -0,0 +1,96 @@ +# Create Jira issues for security findings returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateJiraIssueRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateJiraIssueRequestData.new({ + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + attributes: DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributes.new({}), + relationships: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationships.new({ + _case: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCase.new({ + data: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCaseData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + id: "53e242c6-a7d6-46ad-9680-b8d14753f716", + }), + }), + }), + }), + DatadogAPIClient::V2::CreateJiraIssueRequestData.new({ + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + attributes: DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributes.new({}), + relationships: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationships.new({ + _case: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCase.new({ + data: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCaseData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + id: "195772b2-1f53-41d2-b81e-48c8e6c21d33", + }), + }), + }), + }), + ], + included: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + }), + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + }), + ], + }), + }), + id: "53e242c6-a7d6-46ad-9680-b8d14753f716", + }), + DatadogAPIClient::V2::CreateCaseRequestData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + }), + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + }), + ], + }), + }), + id: "195772b2-1f53-41d2-b81e-48c8e6c21d33", + }), + DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", + }), + ], +}) +p api_instance.create_jira_issues(body) diff --git a/examples/v2/security-monitoring/CreateJiraIssues_379590688.rb b/examples/v2/security-monitoring/CreateJiraIssues_379590688.rb new file mode 100644 index 00000000000..fd584f4c763 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_379590688.rb @@ -0,0 +1,56 @@ +# Create Jira issue for security finding returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateJiraIssueRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateJiraIssueRequestData.new({ + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + attributes: DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributes.new({}), + relationships: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationships.new({ + _case: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCase.new({ + data: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCaseData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + id: "6a773295-8729-4034-aada-53b64cbe02e7", + }), + }), + }), + }), + ], + included: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + }), + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + }), + ], + }), + }), + id: "6a773295-8729-4034-aada-53b64cbe02e7", + }), + DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", + }), + ], +}) +p api_instance.create_jira_issues(body) diff --git a/examples/v2/security-monitoring/CreateJiraIssues_829823123.rb b/examples/v2/security-monitoring/CreateJiraIssues_829823123.rb new file mode 100644 index 00000000000..174c004a087 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_829823123.rb @@ -0,0 +1,64 @@ +# Create Jira issue for security findings returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateJiraIssueRequestArray.new({ + data: [ + DatadogAPIClient::V2::CreateJiraIssueRequestData.new({ + type: DatadogAPIClient::V2::JiraIssuesDataType::JIRA_ISSUES, + attributes: DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributes.new({}), + relationships: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationships.new({ + _case: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCase.new({ + data: DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCaseData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + id: "e469ceda-957a-4557-a607-9ff25032e9ca", + }), + }), + }), + }), + ], + included: [ + DatadogAPIClient::V2::CreateCaseRequestData.new({ + type: DatadogAPIClient::V2::CaseDataType::CASES, + attributes: DatadogAPIClient::V2::CreateCaseRequestDataAttributes.new({ + title: "A title", + description: "A description", + }), + relationships: DatadogAPIClient::V2::CreateCaseRequestDataRelationships.new({ + project: DatadogAPIClient::V2::CaseManagementProject.new({ + data: DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + }), + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + }), + ], + }), + }), + id: "e469ceda-957a-4557-a607-9ff25032e9ca", + }), + DatadogAPIClient::V2::CaseManagementProjectData.new({ + type: DatadogAPIClient::V2::CaseManagementProjectDataType::PROJECTS, + id: "959a6f71-bac8-4027-b1d3-2264f569296f", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + }), + DatadogAPIClient::V2::FindingData.new({ + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + id: "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=", + }), + ], +}) +p api_instance.create_jira_issues(body) diff --git a/examples/v2/security-monitoring/DetachCase.rb b/examples/v2/security-monitoring/DetachCase.rb new file mode 100644 index 00000000000..e39475a93e7 --- /dev/null +++ b/examples/v2/security-monitoring/DetachCase.rb @@ -0,0 +1,21 @@ +# Detach security findings from their case returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::DetachCaseRequest.new({ + data: DatadogAPIClient::V2::DetachCaseRequestData.new({ + relationships: DatadogAPIClient::V2::DetachCaseRequestDataRelationships.new({ + findings: DatadogAPIClient::V2::Findings.new({ + data: [ + DatadogAPIClient::V2::FindingData.new({ + id: "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=", + type: DatadogAPIClient::V2::FindingDataType::FINDINGS, + }), + ], + }), + }), + type: DatadogAPIClient::V2::CaseDataType::CASES, + }), +}) +api_instance.detach_case(body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index d85bc628294..6c5abf05961 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1372,6 +1372,22 @@ "finding_id" => "String", "snapshot_timestamp" => "Integer", }, + "v2.DetachCase" => { + "body" => "DetachCaseRequest", + }, + "v2.CreateCases" => { + "body" => "CreateCaseRequestArray", + }, + "v2.AttachCase" => { + "case_id" => "String", + "body" => "AttachCaseRequest", + }, + "v2.AttachJiraIssue" => { + "body" => "AttachJiraIssueRequest", + }, + "v2.CreateJiraIssues" => { + "body" => "CreateJiraIssueRequestArray", + }, "v2.ListAssetsSBOMs" => { "page_token" => "String", "page_number" => "Integer", diff --git a/features/v2/given.json b/features/v2/given.json index d1d4bce2f10..6c6d3bf98f4 100644 --- a/features/v2/given.json +++ b/features/v2/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/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 531c84c19c1..5599d509afc 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -5,9 +5,83 @@ Feature: Security Monitoring information. Background: - Given an instance of "SecurityMonitoring" API - And a valid "apiKeyAuth" key in the system + Given a valid "apiKeyAuth" key in the system And a valid "appKeyAuth" key in the system + And an instance of "SecurityMonitoring" API + + @team:DataDog/k9-investigation + Scenario: Attach security finding to a Jira issue returns "OK" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" + And the response "data.attributes.jira_issue.result.issue_url" is equal to "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476" + + @team:DataDog/k9-investigation + Scenario: Attach security finding to a case returns "OK" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And body with value {"data": {"id": "7d16945b-baf8-411e-ab2a-20fe43af1ea3", "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a Jira issue returns "Bad Request" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a Jira issue returns "Not Found" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a Jira issue returns "OK" response + Given new "AttachJiraIssue" request + And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}, {"id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" + And the response "data.attributes.insights" has item with field "resource_id" with value "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=" + And the response "data.attributes.jira_issue.result.issue_url" is equal to "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476" + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a case returns "Bad Request" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And body with value {"data": {"id": "7d16945b-baf8-411e-ab2a-20fe43af1ea3", "relationships": {"findings": {"data": []}}, "type": "cases"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a case returns "Not Found" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "wrong-case-id" + And body with value {"data": {"id": "wrong-case-id", "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-investigation + Scenario: Attach security findings to a case returns "OK" response + Given new "AttachCase" request + And request contains "case_id" parameter with value "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And body with value {"data": {"id": "7d16945b-baf8-411e-ab2a-20fe43af1ea3", "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}, {"id": "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "7d16945b-baf8-411e-ab2a-20fe43af1ea3" + And the response "data.attributes.status_group" is equal to "SG_OPEN" + And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data.attributes.insights" has item with field "resource_id" with value "MmUzMzZkODQ2YTI3NDU0OTk4NDk3NzhkOTY5YjU2Zjh-YWJjZGI1ODI4OTYzNWM3ZmUwZTBlOWRkYTRiMGUyOGQ=" @team:DataDog/k9-cloud-security-platform Scenario: Cancel a historical job returns "Bad Request" response @@ -184,6 +258,78 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n" + @team:DataDog/k9-investigation + Scenario: Create Jira issue for security finding returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6a773295-8729-4034-aada-53b64cbe02e7"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]}}, "id": "6a773295-8729-4034-aada-53b64cbe02e7"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y="}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation + Scenario: Create Jira issue for security findings returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]}}, "id": "e469ceda-957a-4557-a607-9ff25032e9ca"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}, {"type": "findings", "id": "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY="}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 2 + And the response "data[0].attributes.insights[1].resource_id" is equal to "MzUxMDI4OWYyYWEyODRhYjQ0Zjg2YjY2ZTFmNjRjYzd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=" + And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZjE2ZGI5YjdmYTQyYzhhMDQ3Nzc3YjM1NGQ2Y2NmZTd-NDU2OWQyNTk1MjM5OGI2NzJjMTVhYjhiODY1ZDcwZWY=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation + Scenario: Create Jira issues for security findings returns "Bad Request" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}}}}], "included": [{"type": "cases", "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": []}}, "id": "a7c38bab-ae98-4113-878c-c98799f914c2"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Create Jira issues for security findings returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes":{}, "relationships": {"case": {"data": {"type": "cases", "id":"53e242c6-a7d6-46ad-9680-b8d14753f716"}}}}, {"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}}}}], "included":[{"type":"cases", "attributes":{"title":"A title", "description":"A description"}, "relationships":{"project":{"data":{"type":"projects", "id":"959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data": [{"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}]}}, "id": "53e242c6-a7d6-46ad-9680-b8d14753f716"}, {"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}}, "findings": {"data":[{"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]}}, "id": "195772b2-1f53-41d2-b81e-48c8e6c21d33"}, {"type": "projects", "id": "959a6f71-bac8-4027-b1d3-2264f569296f"}, {"type": "findings", "id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI="}, {"type": "findings", "id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM="}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 2 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + And the response "data[1]" has field "id" + And the response "data[1].attributes.title" is equal to "A title" + And the response "data[1].attributes.description" is equal to "A description" + And the response "data[1].attributes.type" is equal to "SECURITY" + And the response "data[1].attributes.insights" has length 1 + And the response "data[1].attributes.insights[0].resource_id" is equal to "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=" + And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[1].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation + Scenario: Create Jira issues for security findings returns "Not Found" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"type": "jira_issues", "attributes": {}, "relationships": {"case": {"data": {"type": "cases", "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}}}}], "included": [{"type": "cases", "attributes": {"title": "A title", "description": "A description"}, "relationships": {"project": {"data": {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}}, "findings": {"data": [{"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]}}, "id": "6ed1d7c2-e1a3-4369-b92b-a38d3cc75cf3"}, {"type": "projects", "id": "00000000-0000-0000-0000-000000000000"}, {"type": "findings", "id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM="}]} + When the request is sent + Then the response status is 404 Not Found + @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Create a cloud_configuration rule returns "OK" response Given new "CreateSecurityMonitoringRule" request @@ -408,6 +554,74 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail" And the response "data.attributes.data_exclusion_query" is equal to "account_id:12345" + @team:DataDog/k9-investigation + Scenario: Create case for security finding returns "Created" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + + @team:DataDog/k9-investigation + Scenario: Create case for security findings returns "Created" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}, {"id": "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 2 + And the response "data[0].attributes.insights[1].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.insights[0].resource_id" is equal to "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + + @team:DataDog/k9-investigation + Scenario: Create cases for security findings returns "Bad Request" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "7f198869-c7ef-4afc-97cf-da5cdc13b5c3", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Create cases for security findings returns "Created" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}, {"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 2 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[1]" has field "id" + And the response "data[1].attributes.title" is equal to "A title" + And the response "data[1].attributes.description" is equal to "A description" + And the response "data[1].attributes.type" is equal to "SECURITY" + And the response "data[1].attributes.insights" has length 1 + And the response "data[1].attributes.insights[0].resource_id" is equal to "MzZkNTMxODNmOGZlZmJiYzIyMDg4NzhmM2QyMDExZjB-ZmY5NzUwNDQzYTE0MGIyNDM1MTg4YjkxZDNmMDU4OGU=" + And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" + + @team:DataDog/k9-investigation + Scenario: Create cases for security findings returns "Not Found" response + Given new "CreateCases" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "projects"}}}, "type": "cases"}]} + When the request is sent + Then the response status is 404 Not Found + @team:DataDog/k9-cloud-security-platform Scenario: Delete a custom framework returns "Bad Request" response Given new "DeleteCustomFramework" request @@ -546,6 +760,27 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @team:DataDog/k9-investigation + Scenario: Detach security findings from their case returns "Bad Request" response + Given new "DetachCase" request + And body with value {"data": {"relationships": {"findings": {"data": []}}, "type": "cases"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-investigation + Scenario: Detach security findings from their case returns "No Content" response + Given new "DetachCase" request + And body with value {"data": {"relationships": {"findings": {"data": [{"id": "YzM2MTFjYzcyNmY0Zjg4MTAxZmRlNjQ1MWU1ZGQwYzR-YzI5NzE5Y2Y4MzU4ZjliNzhkNjYxNTY0ODIzZDQ2YTM=", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 204 No Content + + @team:DataDog/k9-investigation + Scenario: Detach security findings from their case returns "Not Found" response + Given new "DetachCase" request + And body with value {"data": {"relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}}, "type": "cases"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/asm-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetSBOM" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 7c226bf60d3..2e54bbe0afb 100644 --- a/features/v2/undo.json +++ b/features/v2/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": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b5a2184aca0..2c5af2ef4ed 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1128,6 +1128,13 @@ def overrides "v2.asset_risks" => "AssetRisks", "v2.asset_type" => "AssetType", "v2.asset_version" => "AssetVersion", + "v2.attach_case_request" => "AttachCaseRequest", + "v2.attach_case_request_data" => "AttachCaseRequestData", + "v2.attach_case_request_data_relationships" => "AttachCaseRequestDataRelationships", + "v2.attach_jira_issue_request" => "AttachJiraIssueRequest", + "v2.attach_jira_issue_request_data" => "AttachJiraIssueRequestData", + "v2.attach_jira_issue_request_data_attributes" => "AttachJiraIssueRequestDataAttributes", + "v2.attach_jira_issue_request_data_relationships" => "AttachJiraIssueRequestDataRelationships", "v2.audit_logs_event" => "AuditLogsEvent", "v2.audit_logs_event_attributes" => "AuditLogsEventAttributes", "v2.audit_logs_events_response" => "AuditLogsEventsResponse", @@ -1347,8 +1354,13 @@ def overrides "v2.case_create_attributes" => "CaseCreateAttributes", "v2.case_create_relationships" => "CaseCreateRelationships", "v2.case_create_request" => "CaseCreateRequest", + "v2.case_data_type" => "CaseDataType", "v2.case_empty" => "CaseEmpty", "v2.case_empty_request" => "CaseEmptyRequest", + "v2.case_insights_items" => "CaseInsightsItems", + "v2.case_management_project" => "CaseManagementProject", + "v2.case_management_project_data" => "CaseManagementProjectData", + "v2.case_management_project_data_type" => "CaseManagementProjectDataType", "v2.case_priority" => "CasePriority", "v2.case_relationships" => "CaseRelationships", "v2.case_resource_type" => "CaseResourceType", @@ -1656,6 +1668,10 @@ def overrides "v2.create_apps_datastore_request_data_attributes_org_access" => "CreateAppsDatastoreRequestDataAttributesOrgAccess", "v2.create_apps_datastore_response" => "CreateAppsDatastoreResponse", "v2.create_apps_datastore_response_data" => "CreateAppsDatastoreResponseData", + "v2.create_case_request_array" => "CreateCaseRequestArray", + "v2.create_case_request_data" => "CreateCaseRequestData", + "v2.create_case_request_data_attributes" => "CreateCaseRequestDataAttributes", + "v2.create_case_request_data_relationships" => "CreateCaseRequestDataRelationships", "v2.create_connection_request" => "CreateConnectionRequest", "v2.create_connection_request_data" => "CreateConnectionRequestData", "v2.create_connection_request_data_attributes" => "CreateConnectionRequestDataAttributes", @@ -1675,6 +1691,14 @@ def overrides "v2.create_deployment_rule_params_data_attributes" => "CreateDeploymentRuleParamsDataAttributes", "v2.create_incident_notification_rule_request" => "CreateIncidentNotificationRuleRequest", "v2.create_incident_notification_template_request" => "CreateIncidentNotificationTemplateRequest", + "v2.create_jira_issue_request_array" => "CreateJiraIssueRequestArray", + "v2.create_jira_issue_request_array_included" => "CreateJiraIssueRequestArrayIncluded", + "v2.create_jira_issue_request_data" => "CreateJiraIssueRequestData", + "v2.create_jira_issue_request_data_attributes" => "CreateJiraIssueRequestDataAttributes", + "v2.create_jira_issue_request_data_attributes_fields" => "CreateJiraIssueRequestDataAttributesFields", + "v2.create_jira_issue_request_data_relationships" => "CreateJiraIssueRequestDataRelationships", + "v2.create_jira_issue_request_data_relationships_case" => "CreateJiraIssueRequestDataRelationshipsCase", + "v2.create_jira_issue_request_data_relationships_case_data" => "CreateJiraIssueRequestDataRelationshipsCaseData", "v2.create_notification_rule_parameters" => "CreateNotificationRuleParameters", "v2.create_notification_rule_parameters_data" => "CreateNotificationRuleParametersData", "v2.create_notification_rule_parameters_data_attributes" => "CreateNotificationRuleParametersDataAttributes", @@ -1905,6 +1929,9 @@ def overrides "v2.deployment_rule_response_data_attributes_type" => "DeploymentRuleResponseDataAttributesType", "v2.deployment_rule_response_data_attributes_updated_by" => "DeploymentRuleResponseDataAttributesUpdatedBy", "v2.deployment_rules_options" => "DeploymentRulesOptions", + "v2.detach_case_request" => "DetachCaseRequest", + "v2.detach_case_request_data" => "DetachCaseRequestData", + "v2.detach_case_request_data_relationships" => "DetachCaseRequestDataRelationships", "v2.detailed_finding" => "DetailedFinding", "v2.detailed_finding_attributes" => "DetailedFindingAttributes", "v2.detailed_finding_type" => "DetailedFindingType", @@ -2189,10 +2216,20 @@ def overrides "v2.filters_per_product" => "FiltersPerProduct", "v2.finding" => "Finding", "v2.finding_attributes" => "FindingAttributes", + "v2.finding_case_response" => "FindingCaseResponse", + "v2.finding_case_response_array" => "FindingCaseResponseArray", + "v2.finding_case_response_data" => "FindingCaseResponseData", + "v2.finding_case_response_data_attributes" => "FindingCaseResponseDataAttributes", + "v2.finding_case_response_data_relationships" => "FindingCaseResponseDataRelationships", + "v2.finding_data" => "FindingData", + "v2.finding_data_type" => "FindingDataType", "v2.finding_evaluation" => "FindingEvaluation", + "v2.finding_jira_issue" => "FindingJiraIssue", + "v2.finding_jira_issue_result" => "FindingJiraIssueResult", "v2.finding_mute" => "FindingMute", "v2.finding_mute_reason" => "FindingMuteReason", "v2.finding_rule" => "FindingRule", + "v2.findings" => "Findings", "v2.finding_status" => "FindingStatus", "v2.finding_type" => "FindingType", "v2.finding_vulnerability_type" => "FindingVulnerabilityType", @@ -2669,6 +2706,7 @@ def overrides "v2.jira_integration_metadata_issues_item" => "JiraIntegrationMetadataIssuesItem", "v2.jira_issue" => "JiraIssue", "v2.jira_issue_result" => "JiraIssueResult", + "v2.jira_issues_data_type" => "JiraIssuesDataType", "v2.job_create_response" => "JobCreateResponse", "v2.job_create_response_data" => "JobCreateResponseData", "v2.job_definition" => "JobDefinition", diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 0a17ce5a0c6..233f52de4f7 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -23,6 +23,145 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Attach security findings to a case. + # + # @see #attach_case_with_http_info + def attach_case(case_id, body, opts = {}) + data, _status_code, _headers = attach_case_with_http_info(case_id, body, opts) + data + end + + # Attach security findings to a case. + # + # Attach security findings to a case. You can attach up to 50 security findings per case. Security findings that are already attached to another case will be detached from their previous case and attached to the specified case. + # + # @param case_id [String] The unique identifier of the case to attach security findings to + # @param body [AttachCaseRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponse, Integer, Hash)>] FindingCaseResponse data, response status code and response headers + def attach_case_with_http_info(case_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.attach_case ...' + end + # verify the required parameter 'case_id' is set + if @api_client.config.client_side_validation && case_id.nil? + fail ArgumentError, "Missing the required parameter 'case_id' when calling SecurityMonitoringAPI.attach_case" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.attach_case" + end + # resource path + local_var_path = '/api/v2/security/findings/cases/{case_id}'.sub('{case_id}', CGI.escape(case_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FindingCaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :attach_case, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#attach_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Attach security findings to a Jira issue. + # + # @see #attach_jira_issue_with_http_info + def attach_jira_issue(body, opts = {}) + data, _status_code, _headers = attach_jira_issue_with_http_info(body, opts) + data + end + + # Attach security findings to a Jira issue. + # + # Attach security findings to a Jira issue by providing the Jira issue URL. You can attach up to 50 security findings per Jira issue. If the Jira issue is not linked to any case, this operation will create a case for the security findings and link the Jira issue to the newly created case. Security findings that are already attached to another Jira issue will be detached from their previous Jira issue and attached to the specified Jira issue. + # + # @param body [AttachJiraIssueRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponse, Integer, Hash)>] FindingCaseResponse data, response status code and response headers + def attach_jira_issue_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.attach_jira_issue ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.attach_jira_issue" + end + # resource path + local_var_path = '/api/v2/security/findings/jira_issues' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FindingCaseResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :attach_jira_issue, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#attach_jira_issue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Cancel a threat hunting job. # # @see #cancel_threat_hunting_job_with_http_info @@ -311,6 +450,73 @@ def convert_security_monitoring_rule_from_json_to_terraform_with_http_info(body, return data, status_code, headers end + # Create cases for security findings. + # + # @see #create_cases_with_http_info + def create_cases(body, opts = {}) + data, _status_code, _headers = create_cases_with_http_info(body, opts) + data + end + + # Create cases for security findings. + # + # Create cases for security findings. You can create up to 50 cases per request and associate up to 50 security findings per case. Security findings that are already attached to another case will be detached from their previous case and attached to the newly created case. + # + # @param body [CreateCaseRequestArray] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponseArray, Integer, Hash)>] FindingCaseResponseArray data, response status code and response headers + def create_cases_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_cases ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_cases" + end + # resource path + local_var_path = '/api/v2/security/findings/cases' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FindingCaseResponseArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_cases, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_cases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a custom framework. # # @see #create_custom_framework_with_http_info @@ -378,6 +584,73 @@ def create_custom_framework_with_http_info(body, opts = {}) return data, status_code, headers end + # Create Jira issues for security findings. + # + # @see #create_jira_issues_with_http_info + def create_jira_issues(body, opts = {}) + data, _status_code, _headers = create_jira_issues_with_http_info(body, opts) + data + end + + # Create Jira issues for security findings. + # + # Create Jira issues for security findings. This operation creates a case in Datadog and a Jira issue linked to that case for bidirectional sync between Datadog and Jira. You can create up to 50 Jira issues per request and associate up to 50 security findings per Jira issue. Security findings that are already attached to another Jira issue will be detached from their previous Jira issue and attached to the newly created Jira issue. + # + # @param body [CreateJiraIssueRequestArray] + # @param opts [Hash] the optional parameters + # @return [Array<(FindingCaseResponseArray, Integer, Hash)>] FindingCaseResponseArray data, response status code and response headers + def create_jira_issues_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_jira_issues ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_jira_issues" + end + # resource path + local_var_path = '/api/v2/security/findings/jira_issues' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'FindingCaseResponseArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_jira_issues, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_jira_issues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a security filter. # # @see #create_security_filter_with_http_info @@ -1182,6 +1455,73 @@ def delete_vulnerability_notification_rule_with_http_info(id, opts = {}) return data, status_code, headers end + # Detach security findings from their case. + # + # @see #detach_case_with_http_info + def detach_case(body, opts = {}) + detach_case_with_http_info(body, opts) + nil + end + + # Detach security findings from their case. + # + # Detach security findings from their case. This operation dissociates security findings from their associated cases without deleting the cases themselves. You can detach security findings from multiple different cases in a single request, with a limit of 50 security findings per request. Security findings that are not currently attached to any case will be ignored. + # + # @param body [DetachCaseRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def detach_case_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.detach_case ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.detach_case" + end + # resource path + local_var_path = '/api/v2/security/findings/cases' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :detach_case, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#detach_case\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Modify the triage assignee of a security signal. # # @see #edit_security_monitoring_signal_assignee_with_http_info @@ -4112,7 +4452,7 @@ def mute_findings_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'BulkMuteFindingsResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :mute_findings, diff --git a/lib/datadog_api_client/v2/models/attach_case_request.rb b/lib/datadog_api_client/v2/models/attach_case_request.rb new file mode 100644 index 00000000000..5cd24d96ce4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_case_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for attaching security findings to a case. + class AttachCaseRequest + include BaseGenericModel + + # Data of the case to attach security findings to. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AttachCaseRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachCaseRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_case_request_data.rb b/lib/datadog_api_client/v2/models/attach_case_request_data.rb new file mode 100644 index 00000000000..bea13b72a2e --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_case_request_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the case to attach security findings to. + class AttachCaseRequestData + include BaseGenericModel + + # The unique identifier of the case. + attr_reader :id + + # Relationships of the case to attach security findings to. + attr_accessor :relationships + + # Cases resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'relationships' => :'AttachCaseRequestDataRelationships', + :'type' => :'CaseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachCaseRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_case_request_data_relationships.rb b/lib/datadog_api_client/v2/models/attach_case_request_data_relationships.rb new file mode 100644 index 00000000000..12cc004a17e --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_case_request_data_relationships.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of the case to attach security findings to. + class AttachCaseRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachCaseRequestDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'findings') + self.findings = attributes[:'findings'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @findings.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + findings == o.findings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_jira_issue_request.rb b/lib/datadog_api_client/v2/models/attach_jira_issue_request.rb new file mode 100644 index 00000000000..0a3bf2b831d --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_jira_issue_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for attaching security findings to a Jira issue. + class AttachJiraIssueRequest + include BaseGenericModel + + # Data of the Jira issue to attach security findings to. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AttachJiraIssueRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachJiraIssueRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_jira_issue_request_data.rb b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data.rb new file mode 100644 index 00000000000..0ab8a9d76e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data.rb @@ -0,0 +1,153 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the Jira issue to attach security findings to. + class AttachJiraIssueRequestData + include BaseGenericModel + + # Attributes of the Jira issue to attach security findings to. + attr_accessor :attributes + + # The unique identifier of the Jira issue attachment request. + attr_accessor :id + + # Relationships of the Jira issue to attach security findings to. + attr_accessor :relationships + + # Jira issues resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AttachJiraIssueRequestDataAttributes', + :'id' => :'String', + :'relationships' => :'AttachJiraIssueRequestDataRelationships', + :'type' => :'JiraIssuesDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachJiraIssueRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_attributes.rb b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_attributes.rb new file mode 100644 index 00000000000..e2536e5f50b --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the Jira issue to attach security findings to. + class AttachJiraIssueRequestDataAttributes + include BaseGenericModel + + # The URL of the Jira issue to attach security findings to. + attr_reader :jira_issue_url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'jira_issue_url' => :'jira_issue_url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'jira_issue_url' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachJiraIssueRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'jira_issue_url') + self.jira_issue_url = attributes[:'jira_issue_url'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @jira_issue_url.nil? + true + end + + # Custom attribute writer method with validation + # @param jira_issue_url [Object] Object to be assigned + # @!visibility private + def jira_issue_url=(jira_issue_url) + if jira_issue_url.nil? + fail ArgumentError, 'invalid value for "jira_issue_url", jira_issue_url cannot be nil.' + end + @jira_issue_url = jira_issue_url + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + jira_issue_url == o.jira_issue_url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [jira_issue_url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_relationships.rb b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_relationships.rb new file mode 100644 index 00000000000..73c39ed4dcf --- /dev/null +++ b/lib/datadog_api_client/v2/models/attach_jira_issue_request_data_relationships.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of the Jira issue to attach security findings to. + class AttachJiraIssueRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + # Case management project. + attr_reader :project + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings', + :'project' => :'CaseManagementProject' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AttachJiraIssueRequestDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'findings') + self.findings = attributes[:'findings'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @findings.nil? + return false if @project.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + end + + # Custom attribute writer method with validation + # @param project [Object] Object to be assigned + # @!visibility private + def project=(project) + if project.nil? + fail ArgumentError, 'invalid value for "project", project cannot be nil.' + end + @project = project + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + findings == o.findings && + project == o.project && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, project, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_data_type.rb b/lib/datadog_api_client/v2/models/case_data_type.rb new file mode 100644 index 00000000000..f116d5d50a4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Cases resource type. + class CaseDataType + include BaseEnumModel + + CASES = "cases".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/case_insights_items.rb b/lib/datadog_api_client/v2/models/case_insights_items.rb new file mode 100644 index 00000000000..e5a4560e510 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_insights_items.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An insight of the case. + class CaseInsightsItems + include BaseGenericModel + + # The reference of the insight. + attr_accessor :ref + + # The unique identifier of the resource. For example, the unique identifier of a security finding. + attr_accessor :resource_id + + # The type of the resource. For example, the type of a security finding is "SECURITY_FINDING". + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ref' => :'ref', + :'resource_id' => :'resource_id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ref' => :'String', + :'resource_id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseInsightsItems` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'ref') + self.ref = attributes[:'ref'] + end + + if attributes.key?(:'resource_id') + self.resource_id = attributes[:'resource_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ref == o.ref && + resource_id == o.resource_id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ref, resource_id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_management_project.rb b/lib/datadog_api_client/v2/models/case_management_project.rb new file mode 100644 index 00000000000..28b2b140fb0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_management_project.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case management project. + class CaseManagementProject + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CaseManagementProjectData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseManagementProject` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_management_project_data.rb b/lib/datadog_api_client/v2/models/case_management_project_data.rb new file mode 100644 index 00000000000..c5b053664ac --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_management_project_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class CaseManagementProjectData + include BaseGenericModel + + # The unique identifier of the case management project. + attr_reader :id + + # Projects resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'CaseManagementProjectDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CaseManagementProjectData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/case_management_project_data_type.rb b/lib/datadog_api_client/v2/models/case_management_project_data_type.rb new file mode 100644 index 00000000000..cb31496ff46 --- /dev/null +++ b/lib/datadog_api_client/v2/models/case_management_project_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Projects resource type. + class CaseManagementProjectDataType + include BaseEnumModel + + PROJECTS = "projects".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/create_case_request_array.rb b/lib/datadog_api_client/v2/models/create_case_request_array.rb new file mode 100644 index 00000000000..007e91d8cd9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_case_request_array.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # List of requests to create cases for security findings. + class CreateCaseRequestArray + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateCaseRequestArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_case_request_data.rb b/lib/datadog_api_client/v2/models/create_case_request_data.rb new file mode 100644 index 00000000000..9e1d63288ee --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_case_request_data.rb @@ -0,0 +1,153 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the case to create. + class CreateCaseRequestData + include BaseGenericModel + + # Attributes of the case to create. + attr_accessor :attributes + + # The unique identifier of the case. + attr_accessor :id + + # Relationships of the case to create. + attr_accessor :relationships + + # Cases resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateCaseRequestDataAttributes', + :'id' => :'String', + :'relationships' => :'CreateCaseRequestDataRelationships', + :'type' => :'CaseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateCaseRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_case_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_case_request_data_attributes.rb new file mode 100644 index 00000000000..f5a8e41c39a --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_case_request_data_attributes.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the case to create. + class CreateCaseRequestDataAttributes + include BaseGenericModel + + # The unique identifier of the user assigned to the case. + attr_accessor :assignee_id + + # The description of the case. If not provided, the description will be automatically generated. + attr_accessor :description + + # Case priority + attr_accessor :priority + + # The title of the case. If not provided, the title will be automatically generated. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee_id' => :'assignee_id', + :'description' => :'description', + :'priority' => :'priority', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee_id' => :'String', + :'description' => :'String', + :'priority' => :'CasePriority', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateCaseRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assignee_id') + self.assignee_id = attributes[:'assignee_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignee_id == o.assignee_id && + description == o.description && + priority == o.priority && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee_id, description, priority, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_case_request_data_relationships.rb b/lib/datadog_api_client/v2/models/create_case_request_data_relationships.rb new file mode 100644 index 00000000000..3aafd4a3ae3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_case_request_data_relationships.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of the case to create. + class CreateCaseRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + # Case management project. + attr_reader :project + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings', + :'project' => :'CaseManagementProject' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateCaseRequestDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'findings') + self.findings = attributes[:'findings'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @findings.nil? + return false if @project.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + end + + # Custom attribute writer method with validation + # @param project [Object] Object to be assigned + # @!visibility private + def project=(project) + if project.nil? + fail ArgumentError, 'invalid value for "project", project cannot be nil.' + end + @project = project + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + findings == o.findings && + project == o.project && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, project, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_array.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_array.rb new file mode 100644 index 00000000000..c8b60c69ca4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_array.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # List of requests to create Jira issues for security findings. + class CreateJiraIssueRequestArray + include BaseGenericModel + + # + attr_reader :data + + # + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateJiraIssueRequestArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_array_included.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_array_included.rb new file mode 100644 index 00000000000..91c485b3fca --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_array_included.rb @@ -0,0 +1,64 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes and relationships of the case linked to the Jira issue. Should contain all of the following: case, project, and security findings. + module CreateJiraIssueRequestArrayIncluded + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CreateCaseRequestData', + :'CaseManagementProjectData', + :'FindingData' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_data.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data.rb new file mode 100644 index 00000000000..489f97d6d3e --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data.rb @@ -0,0 +1,153 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the Jira issue to create. + class CreateJiraIssueRequestData + include BaseGenericModel + + # Attributes of the Jira issue to create. + attr_accessor :attributes + + # The unique identifier of the Jira issue creation request. + attr_accessor :id + + # Relationships of the Jira issue to create. + attr_accessor :relationships + + # Jira issues resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateJiraIssueRequestDataAttributes', + :'id' => :'String', + :'relationships' => :'CreateJiraIssueRequestDataRelationships', + :'type' => :'JiraIssuesDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateJiraIssueRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes.rb new file mode 100644 index 00000000000..37a0be54e25 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the Jira issue to create. + class CreateJiraIssueRequestDataAttributes + include BaseGenericModel + + # Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + attr_accessor :fields + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'CreateJiraIssueRequestDataAttributesFields' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'fields') + self.fields = attributes[:'fields'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + fields == o.fields && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes_fields.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes_fields.rb new file mode 100644 index 00000000000..22bd1a63655 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_attributes_fields.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + class CreateJiraIssueRequestDataAttributesFields + include BaseGenericModel + + # + attr_accessor :fields + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'Object' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateJiraIssueRequestDataAttributesFields` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'fields') + self.fields = attributes[:'fields'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + fields == o.fields && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships.rb new file mode 100644 index 00000000000..f00cceb992c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of the Jira issue to create. + class CreateJiraIssueRequestDataRelationships + include BaseGenericModel + + # Case linked to the Jira issue. + attr_reader :_case + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_case' => :'case' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_case' => :'CreateJiraIssueRequestDataRelationshipsCase' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_case') + self._case = attributes[:'_case'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @_case.nil? + true + end + + # Custom attribute writer method with validation + # @param _case [Object] Object to be assigned + # @!visibility private + def _case=(_case) + if _case.nil? + fail ArgumentError, 'invalid value for "_case", _case cannot be nil.' + end + @_case = _case + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _case == o._case && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_case, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case.rb new file mode 100644 index 00000000000..9e138df5908 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case linked to the Jira issue. + class CreateJiraIssueRequestDataRelationshipsCase + include BaseGenericModel + + # Case linked to the Jira issue. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateJiraIssueRequestDataRelationshipsCaseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCase` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case_data.rb b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case_data.rb new file mode 100644 index 00000000000..23323ec510b --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_jira_issue_request_data_relationships_case_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case linked to the Jira issue. + class CreateJiraIssueRequestDataRelationshipsCaseData + include BaseGenericModel + + # + attr_reader :id + + # Cases resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'CaseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateJiraIssueRequestDataRelationshipsCaseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/detach_case_request.rb b/lib/datadog_api_client/v2/models/detach_case_request.rb new file mode 100644 index 00000000000..28bebfa5887 --- /dev/null +++ b/lib/datadog_api_client/v2/models/detach_case_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for detaching security findings from their case. + class DetachCaseRequest + include BaseGenericModel + + # Data for detaching security findings from their case. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'DetachCaseRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DetachCaseRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/detach_case_request_data.rb b/lib/datadog_api_client/v2/models/detach_case_request_data.rb new file mode 100644 index 00000000000..9533236e76a --- /dev/null +++ b/lib/datadog_api_client/v2/models/detach_case_request_data.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for detaching security findings from their case. + class DetachCaseRequestData + include BaseGenericModel + + # The unique identifier of the detachment request. + attr_accessor :id + + # Relationships detaching security findings from their case. + attr_accessor :relationships + + # Cases resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'relationships' => :'DetachCaseRequestDataRelationships', + :'type' => :'CaseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DetachCaseRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/detach_case_request_data_relationships.rb b/lib/datadog_api_client/v2/models/detach_case_request_data_relationships.rb new file mode 100644 index 00000000000..2f086541b1e --- /dev/null +++ b/lib/datadog_api_client/v2/models/detach_case_request_data_relationships.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships detaching security findings from their case. + class DetachCaseRequestDataRelationships + include BaseGenericModel + + # A list of security findings. + attr_reader :findings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'findings' => :'findings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'findings' => :'Findings' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DetachCaseRequestDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'findings') + self.findings = attributes[:'findings'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @findings.nil? + true + end + + # Custom attribute writer method with validation + # @param findings [Object] Object to be assigned + # @!visibility private + def findings=(findings) + if findings.nil? + fail ArgumentError, 'invalid value for "findings", findings cannot be nil.' + end + @findings = findings + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + findings == o.findings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [findings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_case_response.rb b/lib/datadog_api_client/v2/models/finding_case_response.rb new file mode 100644 index 00000000000..c3024fb0615 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Case response. + class FindingCaseResponse + include BaseGenericModel + + # Data of the case. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'FindingCaseResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingCaseResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_case_response_array.rb b/lib/datadog_api_client/v2/models/finding_case_response_array.rb new file mode 100644 index 00000000000..d57f9fcb81b --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response_array.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # List of case responses. + class FindingCaseResponseArray + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingCaseResponseArray` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_case_response_data.rb b/lib/datadog_api_client/v2/models/finding_case_response_data.rb new file mode 100644 index 00000000000..b1693b8449c --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response_data.rb @@ -0,0 +1,153 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the case. + class FindingCaseResponseData + include BaseGenericModel + + # Attributes of the case. + attr_accessor :attributes + + # The unique identifier of the case. + attr_accessor :id + + # Relationships of the case. + attr_accessor :relationships + + # Cases resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'FindingCaseResponseDataAttributes', + :'id' => :'String', + :'relationships' => :'FindingCaseResponseDataRelationships', + :'type' => :'CaseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingCaseResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb b/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb new file mode 100644 index 00000000000..59cac204598 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response_data_attributes.rb @@ -0,0 +1,277 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the case. + class FindingCaseResponseDataAttributes + include BaseGenericModel + + # Timestamp of when the case was archived. + attr_accessor :archived_at + + # Relationship to user. + attr_accessor :assigned_to + + # + attr_accessor :attributes + + # Timestamp of when the case was closed. + attr_accessor :closed_at + + # Timestamp of when the case was created. + attr_accessor :created_at + + # Source of the case creation. + attr_accessor :creation_source + + # Description of the case. + attr_accessor :description + + # Due date of the case. + attr_accessor :due_date + + # Insights of the case. + attr_accessor :insights + + # Jira issue associated with the case. + attr_accessor :jira_issue + + # Key of the case. + attr_accessor :key + + # Timestamp of when the case was last modified. + attr_accessor :modified_at + + # Priority of the case. + attr_accessor :priority + + # Status of the case. + attr_accessor :status + + # Status group of the case. + attr_accessor :status_group + + # Status name of the case. + attr_accessor :status_name + + # Title of the case. + attr_accessor :title + + # Type of the case. For security cases, this is always "SECURITY". + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'archived_at' => :'archived_at', + :'assigned_to' => :'assigned_to', + :'attributes' => :'attributes', + :'closed_at' => :'closed_at', + :'created_at' => :'created_at', + :'creation_source' => :'creation_source', + :'description' => :'description', + :'due_date' => :'due_date', + :'insights' => :'insights', + :'jira_issue' => :'jira_issue', + :'key' => :'key', + :'modified_at' => :'modified_at', + :'priority' => :'priority', + :'status' => :'status', + :'status_group' => :'status_group', + :'status_name' => :'status_name', + :'title' => :'title', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'archived_at' => :'Time', + :'assigned_to' => :'RelationshipToUser', + :'attributes' => :'Hash>', + :'closed_at' => :'Time', + :'created_at' => :'Time', + :'creation_source' => :'String', + :'description' => :'String', + :'due_date' => :'String', + :'insights' => :'Array', + :'jira_issue' => :'FindingJiraIssue', + :'key' => :'String', + :'modified_at' => :'Time', + :'priority' => :'String', + :'status' => :'String', + :'status_group' => :'String', + :'status_name' => :'String', + :'title' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingCaseResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'archived_at') + self.archived_at = attributes[:'archived_at'] + end + + if attributes.key?(:'assigned_to') + self.assigned_to = attributes[:'assigned_to'] + end + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'closed_at') + self.closed_at = attributes[:'closed_at'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'creation_source') + self.creation_source = attributes[:'creation_source'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'due_date') + self.due_date = attributes[:'due_date'] + end + + if attributes.key?(:'insights') + if (value = attributes[:'insights']).is_a?(Array) + self.insights = value + end + end + + if attributes.key?(:'jira_issue') + self.jira_issue = attributes[:'jira_issue'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'status_group') + self.status_group = attributes[:'status_group'] + end + + if attributes.key?(:'status_name') + self.status_name = attributes[:'status_name'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + archived_at == o.archived_at && + assigned_to == o.assigned_to && + attributes == o.attributes && + closed_at == o.closed_at && + created_at == o.created_at && + creation_source == o.creation_source && + description == o.description && + due_date == o.due_date && + insights == o.insights && + jira_issue == o.jira_issue && + key == o.key && + modified_at == o.modified_at && + priority == o.priority && + status == o.status && + status_group == o.status_group && + status_name == o.status_name && + title == o.title && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [archived_at, assigned_to, attributes, closed_at, created_at, creation_source, description, due_date, insights, jira_issue, key, modified_at, priority, status, status_group, status_name, title, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_case_response_data_relationships.rb b/lib/datadog_api_client/v2/models/finding_case_response_data_relationships.rb new file mode 100644 index 00000000000..b6d172aa826 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_case_response_data_relationships.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of the case. + class FindingCaseResponseDataRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by + + # Relationship to user. + attr_accessor :modified_by + + # Case management project. + attr_accessor :project + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by' => :'created_by', + :'modified_by' => :'modified_by', + :'project' => :'project' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by' => :'RelationshipToUser', + :'modified_by' => :'RelationshipToUser', + :'project' => :'CaseManagementProject' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingCaseResponseDataRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'project') + self.project = attributes[:'project'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by == o.created_by && + modified_by == o.modified_by && + project == o.project && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by, modified_by, project, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_data.rb b/lib/datadog_api_client/v2/models/finding_data.rb new file mode 100644 index 00000000000..8f2b42346ce --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class FindingData + include BaseGenericModel + + # The unique identifier of the security finding. + attr_reader :id + + # Security findings resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'FindingDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_data_type.rb b/lib/datadog_api_client/v2/models/finding_data_type.rb new file mode 100644 index 00000000000..24ae286db51 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Security findings resource type. + class FindingDataType + include BaseEnumModel + + FINDINGS = "findings".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/finding_jira_issue.rb b/lib/datadog_api_client/v2/models/finding_jira_issue.rb new file mode 100644 index 00000000000..44d8ae77709 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_jira_issue.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Jira issue associated with the case. + class FindingJiraIssue + include BaseGenericModel + + # The error message if the Jira issue creation failed. + attr_accessor :error_message + + # Result of the Jira issue creation. + attr_accessor :result + + # The status of the Jira issue creation. Can be "COMPLETED" if the Jira issue was created successfully, or "FAILED" if the Jira issue creation failed. + attr_accessor :status + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'error_message' => :'error_message', + :'result' => :'result', + :'status' => :'status' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error_message' => :'String', + :'result' => :'FindingJiraIssueResult', + :'status' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingJiraIssue` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'result') + self.result = attributes[:'result'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error_message == o.error_message && + result == o.result && + status == o.status && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error_message, result, status, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/finding_jira_issue_result.rb b/lib/datadog_api_client/v2/models/finding_jira_issue_result.rb new file mode 100644 index 00000000000..2eacfe86542 --- /dev/null +++ b/lib/datadog_api_client/v2/models/finding_jira_issue_result.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Result of the Jira issue creation. + class FindingJiraIssueResult + include BaseGenericModel + + # The account ID of the Jira issue. + attr_accessor :account_id + + # The unique identifier of the Jira issue. + attr_accessor :issue_id + + # The key of the Jira issue. + attr_accessor :issue_key + + # The URL of the Jira issue. + attr_accessor :issue_url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'issue_id' => :'issue_id', + :'issue_key' => :'issue_key', + :'issue_url' => :'issue_url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'issue_id' => :'String', + :'issue_key' => :'String', + :'issue_url' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingJiraIssueResult` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'issue_id') + self.issue_id = attributes[:'issue_id'] + end + + if attributes.key?(:'issue_key') + self.issue_key = attributes[:'issue_key'] + end + + if attributes.key?(:'issue_url') + self.issue_url = attributes[:'issue_url'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + issue_id == o.issue_id && + issue_key == o.issue_key && + issue_url == o.issue_url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, issue_id, issue_key, issue_url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/findings.rb b/lib/datadog_api_client/v2/models/findings.rb new file mode 100644 index 00000000000..be8322d06d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/findings.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A list of security findings. + class Findings + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::Findings` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/jira_issues_data_type.rb b/lib/datadog_api_client/v2/models/jira_issues_data_type.rb new file mode 100644 index 00000000000..c02ca66d1ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/jira_issues_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Jira issues resource type. + class JiraIssuesDataType + include BaseEnumModel + + JIRA_ISSUES = "jira_issues".freeze + end +end