diff --git a/.apigentools-info b/.apigentools-info index bfedb67a8f7..4f1cf7c8d31 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-22 15:54:07.509728", - "spec_repo_commit": "7a8ea4b1" + "regenerated": "2025-01-23 14:30:11.213729", + "spec_repo_commit": "e2b0a91f" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-22 15:54:07.525047", - "spec_repo_commit": "7a8ea4b1" + "regenerated": "2025-01-23 14:30:11.228411", + "spec_repo_commit": "e2b0a91f" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a06d74ae8e6..9f213d57a22 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -782,6 +782,28 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden + InboxRulesList: + content: + application/json: + schema: + properties: + data: + items: + $ref: '#/components/schemas/InboxRule' + type: array + type: object + description: The list of inbox rules + MuteRulesList: + content: + application/json: + schema: + properties: + data: + items: + $ref: '#/components/schemas/MuteRule' + type: array + type: object + description: The list of mute rules NotAuthorizedResponse: content: application/json: @@ -836,6 +858,13 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Unauthorized + UnprocessableEntityResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: The server cannot process the request because it contains invalid + data. schemas: APIErrorResponse: description: API error response. @@ -1730,6 +1759,31 @@ components: oneOf: - $ref: '#/components/schemas/AWSIntegrationUpdate' - $ref: '#/components/schemas/HTTPIntegrationUpdate' + ActionInbox: + description: Action of the inbox rule + properties: + reason_description: + description: Free text to add a reason description. + example: We want to focus on these items. + type: string + type: object + ActionMute: + description: Action of the mute rule + properties: + expire_at: + description: End date of the mute rule (null means mute forever) + example: 1893452400000 + format: int64 + type: integer + reason: + $ref: '#/components/schemas/MuteReason' + reason_description: + description: Free text to add a reason description. + example: Muting for a while + type: string + required: + - reason + type: object ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -7403,6 +7457,76 @@ components: meta: $ref: '#/components/schemas/DataDeletionResponseMeta' type: object + CreateInboxRuleParameters: + description: Body of the inbox rule create request + properties: + data: + $ref: '#/components/schemas/CreateInboxRuleParametersData' + type: object + CreateInboxRuleParametersData: + description: 'Data of the inbox rule create request: the rule type, and the + rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateInboxRuleParametersDataAttributes' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - attributes + - type + type: object + CreateInboxRuleParametersDataAttributes: + description: 'Attributes of the inbox rule create request: the rule name, the + rule details, the associated action, and the optional enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionInbox' + enabled: + $ref: '#/components/schemas/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + required: + - action + - name + - rule + type: object + CreateMuteRuleParameters: + description: Body of the mute rule create request + properties: + data: + $ref: '#/components/schemas/CreateMuteRuleParametersData' + type: object + CreateMuteRuleParametersData: + description: 'Data of the mute rule create request: the rule type, and the rule + attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateMuteRuleParametersDataAttributes' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - attributes + - type + type: object + CreateMuteRuleParametersDataAttributes: + description: 'Attributes of the mute rule create request: the rule name, the + rule details, the associated action, and the optional enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionMute' + enabled: + $ref: '#/components/schemas/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + required: + - action + - name + - rule + type: object CreateOpenAPIResponse: description: Response for `CreateOpenAPI` operation. properties: @@ -9115,6 +9239,11 @@ components: type: number type: array type: object + Date: + description: Date as Unix timestamp in milliseconds + example: 1722439510282 + format: int64 + type: integer DeleteAppResponse: description: The definition of `DeleteAppResponse` object. properties: @@ -10297,6 +10426,10 @@ components: - score - severity type: object + Enabled: + description: Field used to enable or disable the rule. + example: true + type: boolean EntityAttributes: description: Entity attributes. properties: @@ -13352,6 +13485,67 @@ components: type: string x-mimetype: application/xml type: object + InboxRule: + description: 'Inbox rules are used to prioritize and add relevant vulnerabilities + to your Security Inbox. + + An inbox rule is composed of a rule UUID, a rule type, and the rule attributes. + All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/InboxRuleAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - attributes + - id + - type + type: object + InboxRuleAttributes: + description: Attributes of the inbox rule + properties: + action: + $ref: '#/components/schemas/ActionInbox' + created_at: + $ref: '#/components/schemas/Date' + created_by: + $ref: '#/components/schemas/RuleUser' + enabled: + $ref: '#/components/schemas/Enabled' + modified_at: + $ref: '#/components/schemas/Date' + modified_by: + $ref: '#/components/schemas/RuleUser' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + required: + - action + - created_at + - created_by + - enabled + - modified_at + - modified_by + - name + - rule + type: object + InboxRuleResponse: + description: Response object which includes an inbox rule. + properties: + data: + $ref: '#/components/schemas/InboxRule' + type: object + InboxRulesType: + description: The pipeline rule type associated to inbox rules + enum: + - inbox_rules + example: inbox_rules + type: string + x-enum-varnames: + - INBOX_RULES IncidentAttachmentAttachmentType: description: The type of the incident attachment attributes. enum: @@ -15557,6 +15751,14 @@ components: - DOWN - WARNING - 'OFF' + IssueType: + description: The type of issues on which the rule applies + enum: + - vulnerability + example: vulnerability + type: string + x-enum-varnames: + - VULNERABILITY JSONAPIErrorItem: description: API error response body properties: @@ -19381,6 +19583,91 @@ components: meta: $ref: '#/components/schemas/MonthlyCostAttributionMeta' type: object + MuteReason: + description: Reason for muting a vulnerability + enum: + - duplicate + - external_solution + - false_positive + - internal_solution + - no_fix_available + - other + - pending_fix + - risk_accepted + example: duplicate + type: string + x-enum-varnames: + - DUPLICATE + - EXTERNAL_SOLUTION + - FALSE_POSITIVE + - INTERNAL_SOLUTION + - NO_FIX_AVAILABLE + - OTHER + - PENDING_FIX + - RISK_ACCEPTED + MuteRule: + description: 'Mute rules are used to proactively filter out known false positives + or accepted risks. + + A mute rule is composed of a rule UUID, a rule type, and the rule attributes. + All fields are required. + + ' + properties: + attributes: + $ref: '#/components/schemas/MuteRuleAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - attributes + - id + - type + type: object + MuteRuleAttributes: + description: Attributes of the mute rule + properties: + action: + $ref: '#/components/schemas/ActionMute' + created_at: + $ref: '#/components/schemas/Date' + created_by: + $ref: '#/components/schemas/RuleUser' + enabled: + $ref: '#/components/schemas/Enabled' + modified_at: + $ref: '#/components/schemas/Date' + modified_by: + $ref: '#/components/schemas/RuleUser' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + required: + - action + - created_at + - created_by + - enabled + - modified_at + - modified_by + - name + - rule + type: object + MuteRuleResponse: + description: Response object which includes a mute rule. + properties: + data: + $ref: '#/components/schemas/MuteRule' + type: object + MuteRulesType: + description: The pipeline rule type associated to mute rules + enum: + - mute_rules + example: mute_rules + type: string + x-enum-varnames: + - MUTE_RULES NullableRelationshipToUser: description: Relationship to user. nullable: true @@ -20234,6 +20521,74 @@ components: $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' type: array type: object + PatchInboxRulesParameters: + description: Body of the inbox rule patch request + properties: + data: + $ref: '#/components/schemas/PatchInboxRulesParametersData' + type: object + PatchInboxRulesParametersData: + description: 'Data of the inbox rule patch request: the rule UUID, the rule + type, and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/PatchInboxRulesParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - attributes + - id + - type + type: object + PatchInboxRulesParametersDataAttributes: + description: 'Attributes of the inbox rule patch request: the rule name, the + rule details, the associated action, and the enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionInbox' + enabled: + $ref: '#/components/schemas/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + type: object + PatchMuteRuleParameters: + description: Body of the mute rule patch request + properties: + data: + $ref: '#/components/schemas/PatchMuteRuleParametersData' + type: object + PatchMuteRuleParametersData: + description: 'Data of the mute rule patch request: the rule UUID, the rule type, + and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/PatchMuteRuleParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - attributes + - id + - type + type: object + PatchMuteRuleParametersDataAttributes: + description: 'Attributes of the mute rule patch request: the rule name, the + rule details, the associated action, and the enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionMute' + enabled: + $ref: '#/components/schemas/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + type: object Permission: description: Permission object. properties: @@ -22227,6 +22582,50 @@ components: - new_advisories - avoided_advisories type: object + ReorderInboxRulesParameters: + description: 'Body of the inbox rule reorder request: the full list of inbox + rules needs to be provided in the new order.' + properties: + data: + description: The `ReorderInboxRulesParameters` `data`. + items: + $ref: '#/components/schemas/ReorderInboxRulesParametersData' + type: array + type: object + ReorderInboxRulesParametersData: + description: 'Data of the inbox rule reorder request: the rule UUID, the rule + type, and the rule attributes. All fields are required.' + properties: + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - id + - type + type: object + ReorderMuteRulesParameters: + description: 'Body of the mute rule reorder request: the full list of mute rules + needs to be provided in the new order.' + properties: + data: + description: The `ReorderMuteRulesParameters` `data`. + items: + $ref: '#/components/schemas/ReorderMuteRulesParametersData' + type: array + type: object + ReorderMuteRulesParametersData: + description: 'Data of the mute rule reorder request: a rule UUID and its type. + All fields are required.' + properties: + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - id + - type + type: object ReorderRetentionFiltersRequest: description: A list of retention filters to reorder. properties: @@ -22874,6 +23273,33 @@ components: type: string x-enum-varnames: - ROLES + Rule: + description: 'The definition of an automation pipeline rule scope. + + A rule can act on specific issue types, security rule types, security rule + IDs, rule severities, or a query. + + The query can be used to filter resources on tags and attributes. + + The issue type and rule types fields are required.' + properties: + issue_type: + $ref: '#/components/schemas/IssueType' + query: + $ref: '#/components/schemas/RuleQuery' + rule_ids: + $ref: '#/components/schemas/RuleIds' + rule_types: + $ref: '#/components/schemas/RuleTypes' + severities: + description: The security rules severities to consider + items: + $ref: '#/components/schemas/RuleSeverity' + type: array + required: + - issue_type + - rule_types + type: object RuleAttributes: description: Details of a rule. properties: @@ -22915,12 +23341,46 @@ components: description: The unique ID for a scorecard rule. example: q8MQxk8TCqrHnWkx type: string + RuleIds: + description: Security rule ids + items: + description: Id of a rule + example: rule-id-1 + type: string + type: array + RuleName: + description: Name of the pipeline rule + example: Rule 1 + type: string RuleOutcomeRelationships: description: The JSON:API relationship to a scorecard rule. properties: rule: $ref: '#/components/schemas/RelationshipToOutcome' type: object + RuleQuery: + description: The query is composed of one or several key:value pairs, which + can be used to filter resources on tags and attributes. + example: key:val + type: string + RuleSeverity: + description: Severity of a security rule + enum: + - critical + - high + - medium + - low + - unknown + - info + example: critical + type: string + x-enum-varnames: + - CRITICAL + - HIGH + - MEDIUM + - LOW + - UNKNOWN + - INFO RuleType: default: rule description: The JSON:API type for scorecard rules. @@ -22930,6 +23390,46 @@ components: type: string x-enum-varnames: - RULE + RuleTypes: + description: Security rule types + example: + - application_code_vulnerability + items: + $ref: '#/components/schemas/RuleTypesItems' + type: array + RuleTypesItems: + description: Security rule type + enum: + - application_code_vulnerability + - application_library_vulnerability + - attack_path + - container_image_vulnerability + - host_vulnerability + - identity_risk + - misconfiguration + - api_security + type: string + x-enum-varnames: + - APPLICATION_CODE_VULNERABILITY + - APPLICATION_LIBRARY_VULNERABILITY + - ATTACK_PATH + - CONTAINER_IMAGE_VULNERABILITY + - HOST_VULNERABILITY + - IDENTITY_RISK + - MISCONFIGURATION + - API_SECURITY + RuleUser: + description: User creating or modifying a rule + properties: + handle: + description: The user handle. + example: john.doe@domain.com + type: string + name: + description: The user name. + example: John Doe + type: string + type: object RumMetricCompute: description: The compute rule to compute the rum-based metric. properties: @@ -29307,6 +29807,11 @@ components: type: string x-enum-varnames: - SECRET + UUID: + description: The ID of a pipeline rule + example: 123e4567-e89b-12d3-a456-426655440000 + format: uuid + type: string Unit: description: Object containing the metric unit family, scale factor, name, and short name. @@ -29540,6 +30045,48 @@ components: deployment: $ref: '#/components/schemas/DeploymentRelationship' type: object + UpdateInboxRuleParameters: + description: Body of the inbox rule update request + properties: + data: + $ref: '#/components/schemas/UpdateInboxRuleParametersData' + type: object + UpdateInboxRuleParametersData: + description: 'Data of the inbox rule update request: the rule id, the rule type, + and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateInboxRuleParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - id + - attributes + - type + type: object + UpdateMuteRuleParameters: + description: Body of the mute rule update request + properties: + data: + $ref: '#/components/schemas/UpdateMuteRuleParametersData' + type: object + UpdateMuteRuleParametersData: + description: 'Data of the mute rule update request: the rule id, the rule type, + and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateMuteRuleParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - id + - attributes + - type + type: object UpdateOpenAPIResponse: description: Response for `UpdateOpenAPI`. properties: @@ -43929,6 +44476,559 @@ paths: x-unstable: '**Note**: This endpoint is a private preview. If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' + /api/v2/security/vulnerabilities/pipelines/inbox_rules: + get: + description: Returns the ordered list of inbox rules in the pipeline (first + match applies) + operationId: GetInboxRules + responses: + '200': + $ref: '#/components/responses/InboxRulesList' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get the ordered list of inbox rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + post: + description: Create a new inbox rule and return the created rule. + operationId: CreateInboxRule + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateInboxRuleParameters' + description: 'Mandatory fields are the rule type and the required attributes: + rule name, rule details, and action. + + The rule details are composed of issue types and security rule types on + which the rule applies. Optional security rule IDs, severities, and a tag + or attribute query can be provided. + + The action is composed of the optional reason description. + + ' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Successfully created the inbox rule + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Create a new inbox rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder: + post: + description: 'Reorder the list of inbox rules in the pipeline and return the + reordered list of rules. + + To reorder fields you need to provide the full list of pipeline rules in the + new order.' + operationId: ReorderInboxRules + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReorderInboxRulesParameters' + description: 'The list of rules to reorder. The order of the rules in the + list will be the new order in the pipeline. + + ' + required: true + responses: + '200': + $ref: '#/components/responses/InboxRulesList' + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Reorder the list of inbox rules in the pipeline + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}: + delete: + description: Delete an inbox rule + operationId: DeleteInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: Rule successfully deleted + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Delete an inbox rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + get: + description: Get the details of an inbox rule. + operationId: GetInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Inbox rule details + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get details of an inbox rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + patch: + description: Partially update the inbox rule. All fields are optional; if a + field is not provided, it will not be updated. + operationId: PatchInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchInboxRulesParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Inbox rule successfully patched + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/UnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Patch an inbox rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + put: + description: Update the whole inbox rule. If an optional field is not provided, + it will be set to its default value. + operationId: UpdateInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateInboxRuleParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Inbox rule successfully updated + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/UnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Update an inbox rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/mute_rules: + get: + description: Returns the ordered list of mute rules in the pipeline (first match + applies) + operationId: GetMuteRules + responses: + '200': + $ref: '#/components/responses/MuteRulesList' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get the ordered list of mute rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + post: + description: Create a new mute rule and return the created rule. + operationId: CreateMuteRule + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateMuteRuleParameters' + description: 'Mandatory fields are the rule type and the required attributes: + rule name, rule details, and action. + + The rule details are composed of issue types and security rule types on + which the rule applies. Optional security rule IDs, severities, and a tag + or attribute query can be provided. + + The action is composed of the reason for muting and the rule expiration + date, and optionally a description of the rule. + + ' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Successfully created the mute rule + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Create a new mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/mute_rules/reorder: + post: + description: 'Reorder the list of mute rules in the pipeline and return the + reordered list of rules. + + To reorder fields you need to provide the full list of pipeline rules in the + new order.' + operationId: ReorderMuteRules + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReorderMuteRulesParameters' + description: 'The list of rules to reorder. The order of the rules in the + list will be the new order in the pipeline. + + ' + required: true + responses: + '200': + $ref: '#/components/responses/MuteRulesList' + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Reorder the list of mute rules in the pipeline + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}: + delete: + description: Delete a mute rule + operationId: DeleteMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: Rule successfully deleted + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Delete a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + get: + description: Get the details of a mute rule. + operationId: GetMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Mute rule details + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get details of a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + patch: + description: Partially update the mute rule. All fields are optional; if a field + is not provided, it will not be updated. + operationId: PatchMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchMuteRuleParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Mute rule successfully patched + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/UnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Patch a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + put: + description: Update the whole mute rule. If an optional field is not provided, + it will be set to its default value. + operationId: UpdateMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMuteRuleParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Mute rule successfully updated + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/UnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Update a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write /api/v2/security_monitoring/cloud_workload_security/agent_rules: get: description: Get the list of Agent rules. diff --git a/examples/v2/security-monitoring/CreateInboxRule.java b/examples/v2/security-monitoring/CreateInboxRule.java new file mode 100644 index 00000000000..a91e09fba00 --- /dev/null +++ b/examples/v2/security-monitoring/CreateInboxRule.java @@ -0,0 +1,56 @@ +// Create a new inbox rule returns "Successfully created the inbox rule" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.ActionInbox; +import com.datadog.api.client.v2.model.CreateInboxRuleParameters; +import com.datadog.api.client.v2.model.CreateInboxRuleParametersData; +import com.datadog.api.client.v2.model.CreateInboxRuleParametersDataAttributes; +import com.datadog.api.client.v2.model.InboxRuleResponse; +import com.datadog.api.client.v2.model.InboxRulesType; +import com.datadog.api.client.v2.model.IssueType; +import com.datadog.api.client.v2.model.Rule; +import com.datadog.api.client.v2.model.RuleSeverity; +import com.datadog.api.client.v2.model.RuleTypesItems; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateInboxRuleParameters body = + new CreateInboxRuleParameters() + .data( + new CreateInboxRuleParametersData() + .attributes( + new CreateInboxRuleParametersDataAttributes() + .action( + new ActionInbox() + .reasonDescription("We want to focus on these items.")) + .enabled(true) + .name("Rule 1") + .rule( + new Rule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + RuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities(Collections.singletonList(RuleSeverity.CRITICAL)))) + .type(InboxRulesType.INBOX_RULES)); + + try { + InboxRuleResponse result = apiInstance.createInboxRule(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createInboxRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/CreateMuteRule.java b/examples/v2/security-monitoring/CreateMuteRule.java new file mode 100644 index 00000000000..d894171e035 --- /dev/null +++ b/examples/v2/security-monitoring/CreateMuteRule.java @@ -0,0 +1,59 @@ +// Create a new mute rule returns "Successfully created the mute rule" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.ActionMute; +import com.datadog.api.client.v2.model.CreateMuteRuleParameters; +import com.datadog.api.client.v2.model.CreateMuteRuleParametersData; +import com.datadog.api.client.v2.model.CreateMuteRuleParametersDataAttributes; +import com.datadog.api.client.v2.model.IssueType; +import com.datadog.api.client.v2.model.MuteReason; +import com.datadog.api.client.v2.model.MuteRuleResponse; +import com.datadog.api.client.v2.model.MuteRulesType; +import com.datadog.api.client.v2.model.Rule; +import com.datadog.api.client.v2.model.RuleSeverity; +import com.datadog.api.client.v2.model.RuleTypesItems; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + CreateMuteRuleParameters body = + new CreateMuteRuleParameters() + .data( + new CreateMuteRuleParametersData() + .attributes( + new CreateMuteRuleParametersDataAttributes() + .action( + new ActionMute() + .expireAt(1893452400000L) + .reason(MuteReason.DUPLICATE) + .reasonDescription("Muting for a while")) + .enabled(true) + .name("Rule 1") + .rule( + new Rule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + RuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities(Collections.singletonList(RuleSeverity.CRITICAL)))) + .type(MuteRulesType.MUTE_RULES)); + + try { + MuteRuleResponse result = apiInstance.createMuteRule(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#createMuteRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/DeleteInboxRule.java b/examples/v2/security-monitoring/DeleteInboxRule.java new file mode 100644 index 00000000000..50b134cb344 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteInboxRule.java @@ -0,0 +1,31 @@ +// Delete an inbox rule returns "Rule successfully deleted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_inbox_rule" in the system + UUID VALID_INBOX_RULE_DATA_ID = null; + try { + VALID_INBOX_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_INBOX_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + apiInstance.deleteInboxRule(VALID_INBOX_RULE_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#deleteInboxRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/DeleteMuteRule.java b/examples/v2/security-monitoring/DeleteMuteRule.java new file mode 100644 index 00000000000..1efb8960450 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteMuteRule.java @@ -0,0 +1,31 @@ +// Delete a mute rule returns "Rule successfully deleted" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_mute_rule" in the system + UUID VALID_MUTE_RULE_DATA_ID = null; + try { + VALID_MUTE_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_MUTE_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + apiInstance.deleteMuteRule(VALID_MUTE_RULE_DATA_ID); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#deleteMuteRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/GetInboxRule.java b/examples/v2/security-monitoring/GetInboxRule.java new file mode 100644 index 00000000000..6aaa8137688 --- /dev/null +++ b/examples/v2/security-monitoring/GetInboxRule.java @@ -0,0 +1,33 @@ +// Get details of an inbox rule returns "Inbox rule details" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.InboxRuleResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_inbox_rule" in the system + UUID VALID_INBOX_RULE_DATA_ID = null; + try { + VALID_INBOX_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_INBOX_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + InboxRuleResponse result = apiInstance.getInboxRule(VALID_INBOX_RULE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#getInboxRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/GetInboxRules.java b/examples/v2/security-monitoring/GetInboxRules.java new file mode 100644 index 00000000000..a68dd3115c5 --- /dev/null +++ b/examples/v2/security-monitoring/GetInboxRules.java @@ -0,0 +1,22 @@ +// Get the ordered list of inbox rules returns "The list of inbox rules" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + apiInstance.getInboxRules(); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#getInboxRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/GetMuteRule.java b/examples/v2/security-monitoring/GetMuteRule.java new file mode 100644 index 00000000000..b521bf9a4cc --- /dev/null +++ b/examples/v2/security-monitoring/GetMuteRule.java @@ -0,0 +1,33 @@ +// Get details of a mute rule returns "Mute rule details" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.MuteRuleResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_mute_rule" in the system + UUID VALID_MUTE_RULE_DATA_ID = null; + try { + VALID_MUTE_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_MUTE_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + MuteRuleResponse result = apiInstance.getMuteRule(VALID_MUTE_RULE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#getMuteRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/GetMuteRules.java b/examples/v2/security-monitoring/GetMuteRules.java new file mode 100644 index 00000000000..e28fcfee6f5 --- /dev/null +++ b/examples/v2/security-monitoring/GetMuteRules.java @@ -0,0 +1,22 @@ +// Get the ordered list of mute rules returns "The list of mute rules" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + apiInstance.getMuteRules(); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#getMuteRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/PatchInboxRule.java b/examples/v2/security-monitoring/PatchInboxRule.java new file mode 100644 index 00000000000..ed4dbede51d --- /dev/null +++ b/examples/v2/security-monitoring/PatchInboxRule.java @@ -0,0 +1,66 @@ +// Patch an inbox rule returns "Inbox rule successfully patched" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.ActionInbox; +import com.datadog.api.client.v2.model.InboxRuleResponse; +import com.datadog.api.client.v2.model.InboxRulesType; +import com.datadog.api.client.v2.model.IssueType; +import com.datadog.api.client.v2.model.PatchInboxRulesParameters; +import com.datadog.api.client.v2.model.PatchInboxRulesParametersData; +import com.datadog.api.client.v2.model.PatchInboxRulesParametersDataAttributes; +import com.datadog.api.client.v2.model.Rule; +import com.datadog.api.client.v2.model.RuleSeverity; +import com.datadog.api.client.v2.model.RuleTypesItems; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_inbox_rule" in the system + UUID VALID_INBOX_RULE_DATA_ID = null; + try { + VALID_INBOX_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_INBOX_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + PatchInboxRulesParameters body = + new PatchInboxRulesParameters() + .data( + new PatchInboxRulesParametersData() + .attributes( + new PatchInboxRulesParametersDataAttributes() + .action( + new ActionInbox() + .reasonDescription("We want to focus on these items.")) + .enabled(true) + .name("Rule 1") + .rule( + new Rule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + RuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities(Collections.singletonList(RuleSeverity.CRITICAL)))) + .id(VALID_INBOX_RULE_DATA_ID) + .type(InboxRulesType.INBOX_RULES)); + + try { + InboxRuleResponse result = apiInstance.patchInboxRule(VALID_INBOX_RULE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#patchInboxRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/PatchMuteRule.java b/examples/v2/security-monitoring/PatchMuteRule.java new file mode 100644 index 00000000000..1db82ec7f65 --- /dev/null +++ b/examples/v2/security-monitoring/PatchMuteRule.java @@ -0,0 +1,69 @@ +// Patch a mute rule returns "Mute rule successfully patched" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.ActionMute; +import com.datadog.api.client.v2.model.IssueType; +import com.datadog.api.client.v2.model.MuteReason; +import com.datadog.api.client.v2.model.MuteRuleResponse; +import com.datadog.api.client.v2.model.MuteRulesType; +import com.datadog.api.client.v2.model.PatchMuteRuleParameters; +import com.datadog.api.client.v2.model.PatchMuteRuleParametersData; +import com.datadog.api.client.v2.model.PatchMuteRuleParametersDataAttributes; +import com.datadog.api.client.v2.model.Rule; +import com.datadog.api.client.v2.model.RuleSeverity; +import com.datadog.api.client.v2.model.RuleTypesItems; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_mute_rule" in the system + UUID VALID_MUTE_RULE_DATA_ID = null; + try { + VALID_MUTE_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_MUTE_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + PatchMuteRuleParameters body = + new PatchMuteRuleParameters() + .data( + new PatchMuteRuleParametersData() + .attributes( + new PatchMuteRuleParametersDataAttributes() + .action( + new ActionMute() + .expireAt(1893452400000L) + .reason(MuteReason.DUPLICATE) + .reasonDescription("Muting for a while")) + .enabled(true) + .name("Rule 1") + .rule( + new Rule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + RuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities(Collections.singletonList(RuleSeverity.CRITICAL)))) + .id(VALID_MUTE_RULE_DATA_ID) + .type(MuteRulesType.MUTE_RULES)); + + try { + MuteRuleResponse result = apiInstance.patchMuteRule(VALID_MUTE_RULE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#patchMuteRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/ReorderInboxRules.java b/examples/v2/security-monitoring/ReorderInboxRules.java new file mode 100644 index 00000000000..0fd6deb1594 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderInboxRules.java @@ -0,0 +1,35 @@ +// Reorder the list of inbox rules in the pipeline returns "The list of inbox rules" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.InboxRulesType; +import com.datadog.api.client.v2.model.ReorderInboxRulesParameters; +import com.datadog.api.client.v2.model.ReorderInboxRulesParametersData; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + ReorderInboxRulesParameters body = + new ReorderInboxRulesParameters() + .data( + Collections.singletonList( + new ReorderInboxRulesParametersData() + .id(UUID.fromString("123e4567-e89b-12d3-a456-426655440000")) + .type(InboxRulesType.INBOX_RULES))); + + try { + apiInstance.reorderInboxRules(body); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#reorderInboxRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/ReorderMuteRules.java b/examples/v2/security-monitoring/ReorderMuteRules.java new file mode 100644 index 00000000000..60a7964db78 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderMuteRules.java @@ -0,0 +1,35 @@ +// Reorder the list of mute rules in the pipeline returns "The list of mute rules" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.MuteRulesType; +import com.datadog.api.client.v2.model.ReorderMuteRulesParameters; +import com.datadog.api.client.v2.model.ReorderMuteRulesParametersData; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + ReorderMuteRulesParameters body = + new ReorderMuteRulesParameters() + .data( + Collections.singletonList( + new ReorderMuteRulesParametersData() + .id(UUID.fromString("123e4567-e89b-12d3-a456-426655440000")) + .type(MuteRulesType.MUTE_RULES))); + + try { + apiInstance.reorderMuteRules(body); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#reorderMuteRules"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/UpdateInboxRule.java b/examples/v2/security-monitoring/UpdateInboxRule.java new file mode 100644 index 00000000000..3cea38498a3 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateInboxRule.java @@ -0,0 +1,66 @@ +// Update an inbox rule returns "Inbox rule successfully updated" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.ActionInbox; +import com.datadog.api.client.v2.model.CreateInboxRuleParametersDataAttributes; +import com.datadog.api.client.v2.model.InboxRuleResponse; +import com.datadog.api.client.v2.model.InboxRulesType; +import com.datadog.api.client.v2.model.IssueType; +import com.datadog.api.client.v2.model.Rule; +import com.datadog.api.client.v2.model.RuleSeverity; +import com.datadog.api.client.v2.model.RuleTypesItems; +import com.datadog.api.client.v2.model.UpdateInboxRuleParameters; +import com.datadog.api.client.v2.model.UpdateInboxRuleParametersData; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_inbox_rule" in the system + UUID VALID_INBOX_RULE_DATA_ID = null; + try { + VALID_INBOX_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_INBOX_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + UpdateInboxRuleParameters body = + new UpdateInboxRuleParameters() + .data( + new UpdateInboxRuleParametersData() + .attributes( + new CreateInboxRuleParametersDataAttributes() + .action( + new ActionInbox() + .reasonDescription("We want to focus on these items.")) + .enabled(true) + .name("Rule 1") + .rule( + new Rule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + RuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities(Collections.singletonList(RuleSeverity.CRITICAL)))) + .id(VALID_INBOX_RULE_DATA_ID) + .type(InboxRulesType.INBOX_RULES)); + + try { + InboxRuleResponse result = apiInstance.updateInboxRule(VALID_INBOX_RULE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#updateInboxRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/security-monitoring/UpdateMuteRule.java b/examples/v2/security-monitoring/UpdateMuteRule.java new file mode 100644 index 00000000000..8d6e7c55476 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateMuteRule.java @@ -0,0 +1,69 @@ +// Update a mute rule returns "Mute rule successfully updated" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.ActionMute; +import com.datadog.api.client.v2.model.CreateMuteRuleParametersDataAttributes; +import com.datadog.api.client.v2.model.IssueType; +import com.datadog.api.client.v2.model.MuteReason; +import com.datadog.api.client.v2.model.MuteRuleResponse; +import com.datadog.api.client.v2.model.MuteRulesType; +import com.datadog.api.client.v2.model.Rule; +import com.datadog.api.client.v2.model.RuleSeverity; +import com.datadog.api.client.v2.model.RuleTypesItems; +import com.datadog.api.client.v2.model.UpdateMuteRuleParameters; +import com.datadog.api.client.v2.model.UpdateMuteRuleParametersData; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_mute_rule" in the system + UUID VALID_MUTE_RULE_DATA_ID = null; + try { + VALID_MUTE_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_MUTE_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + UpdateMuteRuleParameters body = + new UpdateMuteRuleParameters() + .data( + new UpdateMuteRuleParametersData() + .attributes( + new CreateMuteRuleParametersDataAttributes() + .action( + new ActionMute() + .expireAt(1893452400000L) + .reason(MuteReason.DUPLICATE) + .reasonDescription("Muting for a while")) + .enabled(true) + .name("Rule 1") + .rule( + new Rule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + RuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities(Collections.singletonList(RuleSeverity.CRITICAL)))) + .id(VALID_MUTE_RULE_DATA_ID) + .type(MuteRulesType.MUTE_RULES)); + + try { + MuteRuleResponse result = apiInstance.updateMuteRule(VALID_MUTE_RULE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#updateMuteRule"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index f1bb85ff054..ce27a87d889 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -9,6 +9,8 @@ import com.datadog.api.client.v2.model.BulkMuteFindingsRequest; import com.datadog.api.client.v2.model.BulkMuteFindingsResponse; import com.datadog.api.client.v2.model.ConvertJobResultsToSignalsRequest; +import com.datadog.api.client.v2.model.CreateInboxRuleParameters; +import com.datadog.api.client.v2.model.CreateMuteRuleParameters; import com.datadog.api.client.v2.model.Finding; import com.datadog.api.client.v2.model.FindingEvaluation; import com.datadog.api.client.v2.model.FindingStatus; @@ -16,11 +18,17 @@ import com.datadog.api.client.v2.model.GetFindingResponse; import com.datadog.api.client.v2.model.GetSBOMResponse; import com.datadog.api.client.v2.model.HistoricalJobResponse; +import com.datadog.api.client.v2.model.InboxRuleResponse; import com.datadog.api.client.v2.model.JobCreateResponse; import com.datadog.api.client.v2.model.ListFindingsResponse; import com.datadog.api.client.v2.model.ListHistoricalJobsResponse; import com.datadog.api.client.v2.model.ListVulnerabilitiesResponse; import com.datadog.api.client.v2.model.ListVulnerableAssetsResponse; +import com.datadog.api.client.v2.model.MuteRuleResponse; +import com.datadog.api.client.v2.model.PatchInboxRulesParameters; +import com.datadog.api.client.v2.model.PatchMuteRuleParameters; +import com.datadog.api.client.v2.model.ReorderInboxRulesParameters; +import com.datadog.api.client.v2.model.ReorderMuteRulesParameters; import com.datadog.api.client.v2.model.RunHistoricalJobRequest; import com.datadog.api.client.v2.model.SecurityFilterCreateRequest; import com.datadog.api.client.v2.model.SecurityFilterResponse; @@ -49,6 +57,8 @@ import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionResponse; import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionUpdateRequest; import com.datadog.api.client.v2.model.SecurityMonitoringSuppressionsResponse; +import com.datadog.api.client.v2.model.UpdateInboxRuleParameters; +import com.datadog.api.client.v2.model.UpdateMuteRuleParameters; import com.datadog.api.client.v2.model.VulnerabilityEcosystem; import com.datadog.api.client.v2.model.VulnerabilitySeverity; import com.datadog.api.client.v2.model.VulnerabilityStatus; @@ -62,6 +72,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.concurrent.CompletableFuture; @jakarta.annotation.Generated( @@ -687,6 +698,300 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS new GenericType() {}); } + /** + * Create a new inbox rule. + * + *

See {@link #createInboxRuleWithHttpInfo}. + * + * @param body Mandatory fields are the rule type and the required attributes: rule name, rule + * details, and action. The rule details are composed of issue types and security rule types + * on which the rule applies. Optional security rule IDs, severities, and a tag or attribute + * query can be provided. The action is composed of the optional reason description. + * (required) + * @return InboxRuleResponse + * @throws ApiException if fails to make API call + */ + public InboxRuleResponse createInboxRule(CreateInboxRuleParameters body) throws ApiException { + return createInboxRuleWithHttpInfo(body).getData(); + } + + /** + * Create a new inbox rule. + * + *

See {@link #createInboxRuleWithHttpInfoAsync}. + * + * @param body Mandatory fields are the rule type and the required attributes: rule name, rule + * details, and action. The rule details are composed of issue types and security rule types + * on which the rule applies. Optional security rule IDs, severities, and a tag or attribute + * query can be provided. The action is composed of the optional reason description. + * (required) + * @return CompletableFuture<InboxRuleResponse> + */ + public CompletableFuture createInboxRuleAsync(CreateInboxRuleParameters body) { + return createInboxRuleWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new inbox rule and return the created rule. + * + * @param body Mandatory fields are the rule type and the required attributes: rule name, rule + * details, and action. The rule details are composed of issue types and security rule types + * on which the rule applies. Optional security rule IDs, severities, and a tag or attribute + * query can be provided. The action is composed of the optional reason description. + * (required) + * @return ApiResponse<InboxRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Successfully created the inbox rule -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createInboxRuleWithHttpInfo(CreateInboxRuleParameters body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createInboxRule"); + } + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createInboxRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a new inbox rule. + * + *

See {@link #createInboxRuleWithHttpInfo}. + * + * @param body Mandatory fields are the rule type and the required attributes: rule name, rule + * details, and action. The rule details are composed of issue types and security rule types + * on which the rule applies. Optional security rule IDs, severities, and a tag or attribute + * query can be provided. The action is composed of the optional reason description. + * (required) + * @return CompletableFuture<ApiResponse<InboxRuleResponse>> + */ + public CompletableFuture> createInboxRuleWithHttpInfoAsync( + CreateInboxRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createInboxRule")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createInboxRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a new mute rule. + * + *

See {@link #createMuteRuleWithHttpInfo}. + * + * @param body Mandatory fields are the rule type and the required attributes: rule name, rule + * details, and action. The rule details are composed of issue types and security rule types + * on which the rule applies. Optional security rule IDs, severities, and a tag or attribute + * query can be provided. The action is composed of the reason for muting and the rule + * expiration date, and optionally a description of the rule. (required) + * @return MuteRuleResponse + * @throws ApiException if fails to make API call + */ + public MuteRuleResponse createMuteRule(CreateMuteRuleParameters body) throws ApiException { + return createMuteRuleWithHttpInfo(body).getData(); + } + + /** + * Create a new mute rule. + * + *

See {@link #createMuteRuleWithHttpInfoAsync}. + * + * @param body Mandatory fields are the rule type and the required attributes: rule name, rule + * details, and action. The rule details are composed of issue types and security rule types + * on which the rule applies. Optional security rule IDs, severities, and a tag or attribute + * query can be provided. The action is composed of the reason for muting and the rule + * expiration date, and optionally a description of the rule. (required) + * @return CompletableFuture<MuteRuleResponse> + */ + public CompletableFuture createMuteRuleAsync(CreateMuteRuleParameters body) { + return createMuteRuleWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new mute rule and return the created rule. + * + * @param body Mandatory fields are the rule type and the required attributes: rule name, rule + * details, and action. The rule details are composed of issue types and security rule types + * on which the rule applies. Optional security rule IDs, severities, and a tag or attribute + * query can be provided. The action is composed of the reason for muting and the rule + * expiration date, and optionally a description of the rule. (required) + * @return ApiResponse<MuteRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
201 Successfully created the mute rule -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createMuteRuleWithHttpInfo(CreateMuteRuleParameters body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createMuteRule"); + } + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createMuteRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a new mute rule. + * + *

See {@link #createMuteRuleWithHttpInfo}. + * + * @param body Mandatory fields are the rule type and the required attributes: rule name, rule + * details, and action. The rule details are composed of issue types and security rule types + * on which the rule applies. Optional security rule IDs, severities, and a tag or attribute + * query can be provided. The action is composed of the reason for muting and the rule + * expiration date, and optionally a description of the rule. (required) + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> + */ + public CompletableFuture> createMuteRuleWithHttpInfoAsync( + CreateMuteRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling createMuteRule")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createMuteRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Create a security filter. * @@ -1255,27 +1560,27 @@ public CompletableFuture> deleteHistoricalJobWithHttpInfoAsync } /** - * Delete a security filter. + * Delete an inbox rule. * - *

See {@link #deleteSecurityFilterWithHttpInfo}. + *

See {@link #deleteInboxRuleWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) + * @param inboxRuleId ID of the inbox rule (required) * @throws ApiException if fails to make API call */ - public void deleteSecurityFilter(String securityFilterId) throws ApiException { - deleteSecurityFilterWithHttpInfo(securityFilterId); + public void deleteInboxRule(UUID inboxRuleId) throws ApiException { + deleteInboxRuleWithHttpInfo(inboxRuleId); } /** - * Delete a security filter. + * Delete an inbox rule. * - *

See {@link #deleteSecurityFilterWithHttpInfoAsync}. + *

See {@link #deleteInboxRuleWithHttpInfoAsync}. * - * @param securityFilterId The ID of the security filter. (required) + * @param inboxRuleId ID of the inbox rule (required) * @return CompletableFuture */ - public CompletableFuture deleteSecurityFilterAsync(String securityFilterId) { - return deleteSecurityFilterWithHttpInfoAsync(securityFilterId) + public CompletableFuture deleteInboxRuleAsync(UUID inboxRuleId) { + return deleteInboxRuleWithHttpInfoAsync(inboxRuleId) .thenApply( response -> { return response.getData(); @@ -1283,43 +1588,40 @@ public CompletableFuture deleteSecurityFilterAsync(String securityFilterId } /** - * Delete a specific security filter. + * Delete an inbox rule * - * @param securityFilterId The ID of the security filter. (required) + * @param inboxRuleId ID of the inbox rule (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
204 OK -
403 Not Authorized -
204 Rule successfully deleted -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteSecurityFilterWithHttpInfo(String securityFilterId) - throws ApiException { + public ApiResponse deleteInboxRuleWithHttpInfo(UUID inboxRuleId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'securityFilterId' is set - if (securityFilterId == null) { + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { throw new ApiException( - 400, - "Missing the required parameter 'securityFilterId' when calling deleteSecurityFilter"); + 400, "Missing the required parameter 'inboxRuleId' when calling deleteInboxRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" + "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}" .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + "\\{" + "inbox_rule_id" + "\\}", apiClient.escapeString(inboxRuleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityFilter", + "v2.SecurityMonitoringApi.deleteInboxRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1338,33 +1640,29 @@ public ApiResponse deleteSecurityFilterWithHttpInfo(String securityFilterI } /** - * Delete a security filter. + * Delete an inbox rule. * - *

See {@link #deleteSecurityFilterWithHttpInfo}. + *

See {@link #deleteInboxRuleWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) + * @param inboxRuleId ID of the inbox rule (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteSecurityFilterWithHttpInfoAsync( - String securityFilterId) { + public CompletableFuture> deleteInboxRuleWithHttpInfoAsync(UUID inboxRuleId) { Object localVarPostBody = null; - // verify the required parameter 'securityFilterId' is set - if (securityFilterId == null) { + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'securityFilterId' when calling" - + " deleteSecurityFilter")); + 400, "Missing the required parameter 'inboxRuleId' when calling deleteInboxRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" + "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}" .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + "\\{" + "inbox_rule_id" + "\\}", apiClient.escapeString(inboxRuleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1372,7 +1670,7 @@ public CompletableFuture> deleteSecurityFilterWithHttpInfoAsyn try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityFilter", + "v2.SecurityMonitoringApi.deleteInboxRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1396,27 +1694,27 @@ public CompletableFuture> deleteSecurityFilterWithHttpInfoAsyn } /** - * Delete an existing rule. + * Delete a mute rule. * - *

See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #deleteMuteRuleWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) + * @param muteRuleId ID of the mute rule (required) * @throws ApiException if fails to make API call */ - public void deleteSecurityMonitoringRule(String ruleId) throws ApiException { - deleteSecurityMonitoringRuleWithHttpInfo(ruleId); + public void deleteMuteRule(UUID muteRuleId) throws ApiException { + deleteMuteRuleWithHttpInfo(muteRuleId); } /** - * Delete an existing rule. + * Delete a mute rule. * - *

See {@link #deleteSecurityMonitoringRuleWithHttpInfoAsync}. + *

See {@link #deleteMuteRuleWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) + * @param muteRuleId ID of the mute rule (required) * @return CompletableFuture */ - public CompletableFuture deleteSecurityMonitoringRuleAsync(String ruleId) { - return deleteSecurityMonitoringRuleWithHttpInfoAsync(ruleId) + public CompletableFuture deleteMuteRuleAsync(UUID muteRuleId) { + return deleteMuteRuleWithHttpInfoAsync(muteRuleId) .thenApply( response -> { return response.getData(); @@ -1424,40 +1722,40 @@ public CompletableFuture deleteSecurityMonitoringRuleAsync(String ruleId) } /** - * Delete an existing rule. Default rules cannot be deleted. + * Delete a mute rule * - * @param ruleId The ID of the rule. (required) + * @param muteRuleId ID of the mute rule (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
204 OK -
403 Not Authorized -
204 Rule successfully deleted -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteSecurityMonitoringRuleWithHttpInfo(String ruleId) - throws ApiException { + public ApiResponse deleteMuteRuleWithHttpInfo(UUID muteRuleId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'ruleId' is set - if (ruleId == null) { + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { throw new ApiException( - 400, "Missing the required parameter 'ruleId' when calling deleteSecurityMonitoringRule"); + 400, "Missing the required parameter 'muteRuleId' when calling deleteMuteRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", + "v2.SecurityMonitoringApi.deleteMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1476,30 +1774,29 @@ public ApiResponse deleteSecurityMonitoringRuleWithHttpInfo(String ruleId) } /** - * Delete an existing rule. + * Delete a mute rule. * - *

See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #deleteMuteRuleWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) + * @param muteRuleId ID of the mute rule (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteSecurityMonitoringRuleWithHttpInfoAsync( - String ruleId) { + public CompletableFuture> deleteMuteRuleWithHttpInfoAsync(UUID muteRuleId) { Object localVarPostBody = null; - // verify the required parameter 'ruleId' is set - if (ruleId == null) { + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'ruleId' when calling deleteSecurityMonitoringRule")); + 400, "Missing the required parameter 'muteRuleId' when calling deleteMuteRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1507,7 +1804,7 @@ public CompletableFuture> deleteSecurityMonitoringRuleWithHttp try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", + "v2.SecurityMonitoringApi.deleteMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1531,27 +1828,27 @@ public CompletableFuture> deleteSecurityMonitoringRuleWithHttp } /** - * Delete a suppression rule. + * Delete a security filter. * - *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #deleteSecurityFilterWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) + * @param securityFilterId The ID of the security filter. (required) * @throws ApiException if fails to make API call */ - public void deleteSecurityMonitoringSuppression(String suppressionId) throws ApiException { - deleteSecurityMonitoringSuppressionWithHttpInfo(suppressionId); + public void deleteSecurityFilter(String securityFilterId) throws ApiException { + deleteSecurityFilterWithHttpInfo(securityFilterId); } /** - * Delete a suppression rule. + * Delete a security filter. * - *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfoAsync}. + *

See {@link #deleteSecurityFilterWithHttpInfoAsync}. * - * @param suppressionId The ID of the suppression rule (required) + * @param securityFilterId The ID of the security filter. (required) * @return CompletableFuture */ - public CompletableFuture deleteSecurityMonitoringSuppressionAsync(String suppressionId) { - return deleteSecurityMonitoringSuppressionWithHttpInfoAsync(suppressionId) + public CompletableFuture deleteSecurityFilterAsync(String securityFilterId) { + return deleteSecurityFilterWithHttpInfoAsync(securityFilterId) .thenApply( response -> { return response.getData(); @@ -1559,9 +1856,9 @@ public CompletableFuture deleteSecurityMonitoringSuppressionAsync(String s } /** - * Delete a specific suppression rule. + * Delete a specific security filter. * - * @param suppressionId The ID of the suppression rule (required) + * @param securityFilterId The ID of the security filter. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -1574,28 +1871,28 @@ public CompletableFuture deleteSecurityMonitoringSuppressionAsync(String s * 429 Too many requests - * */ - public ApiResponse deleteSecurityMonitoringSuppressionWithHttpInfo(String suppressionId) + public ApiResponse deleteSecurityFilterWithHttpInfo(String securityFilterId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { throw new ApiException( 400, - "Missing the required parameter 'suppressionId' when calling" - + " deleteSecurityMonitoringSuppression"); + "Missing the required parameter 'securityFilterId' when calling deleteSecurityFilter"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.deleteSecurityFilter", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1614,32 +1911,33 @@ public ApiResponse deleteSecurityMonitoringSuppressionWithHttpInfo(String } /** - * Delete a suppression rule. + * Delete a security filter. * - *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #deleteSecurityFilterWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) + * @param securityFilterId The ID of the security filter. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteSecurityMonitoringSuppressionWithHttpInfoAsync( - String suppressionId) { + public CompletableFuture> deleteSecurityFilterWithHttpInfoAsync( + String securityFilterId) { Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'suppressionId' when calling" - + " deleteSecurityMonitoringSuppression")); + "Missing the required parameter 'securityFilterId' when calling" + + " deleteSecurityFilter")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1647,7 +1945,7 @@ public CompletableFuture> deleteSecurityMonitoringSuppressionW try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.deleteSecurityFilter", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1671,33 +1969,27 @@ public CompletableFuture> deleteSecurityMonitoringSuppressionW } /** - * Modify the triage assignee of a security signal. + * Delete an existing rule. * - *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return SecurityMonitoringSignalTriageUpdateResponse + * @param ruleId The ID of the rule. (required) * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalAssignee( - String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) throws ApiException { - return editSecurityMonitoringSignalAssigneeWithHttpInfo(signalId, body).getData(); + public void deleteSecurityMonitoringRule(String ruleId) throws ApiException { + deleteSecurityMonitoringRuleWithHttpInfo(ruleId); } /** - * Modify the triage assignee of a security signal. + * Delete an existing rule. * - *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfoAsync}. + *

See {@link #deleteSecurityMonitoringRuleWithHttpInfoAsync}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture */ - public CompletableFuture - editSecurityMonitoringSignalAssigneeAsync( - String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { - return editSecurityMonitoringSignalAssigneeWithHttpInfoAsync(signalId, body) + public CompletableFuture deleteSecurityMonitoringRuleAsync(String ruleId) { + return deleteSecurityMonitoringRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -1705,112 +1997,82 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Modify the triage assignee of a security signal. + * Delete an existing rule. Default rules cannot be deleted. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> + * @param ruleId The ID of the rule. (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
204 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - editSecurityMonitoringSignalAssigneeWithHttpInfo( - String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalAssignee"); - } + public ApiResponse deleteSecurityMonitoringRuleWithHttpInfo(String ruleId) + throws ApiException { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalAssignee"); + 400, "Missing the required parameter 'ruleId' when calling deleteSecurityMonitoringRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/assignee" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security_monitoring/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Modify the triage assignee of a security signal. + * Delete an existing rule. * - *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - editSecurityMonitoringSignalAssigneeWithHttpInfoAsync( - String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { - Object localVarPostBody = body; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalAssignee")); - return result; - } + public CompletableFuture> deleteSecurityMonitoringRuleWithHttpInfoAsync( + String ruleId) { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalAssignee")); + "Missing the required parameter 'ruleId' when calling deleteSecurityMonitoringRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/assignee" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security_monitoring/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1818,58 +2080,51 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Change the related incidents of a security signal. + * Delete a suppression rule. * - *

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return SecurityMonitoringSignalTriageUpdateResponse + * @param suppressionId The ID of the suppression rule (required) * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalIncidents( - String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) throws ApiException { - return editSecurityMonitoringSignalIncidentsWithHttpInfo(signalId, body).getData(); + public void deleteSecurityMonitoringSuppression(String suppressionId) throws ApiException { + deleteSecurityMonitoringSuppressionWithHttpInfo(suppressionId); } /** - * Change the related incidents of a security signal. + * Delete a suppression rule. * - *

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfoAsync}. + *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfoAsync}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + * @param suppressionId The ID of the suppression rule (required) + * @return CompletableFuture */ - public CompletableFuture - editSecurityMonitoringSignalIncidentsAsync( - String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { - return editSecurityMonitoringSignalIncidentsWithHttpInfoAsync(signalId, body) + public CompletableFuture deleteSecurityMonitoringSuppressionAsync(String suppressionId) { + return deleteSecurityMonitoringSuppressionWithHttpInfoAsync(suppressionId) .thenApply( response -> { return response.getData(); @@ -1877,27 +2132,172 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Change the related incidents for a security signal. + * Delete a specific suppression rule. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> + * @param suppressionId The ID of the suppression rule (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
204 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteSecurityMonitoringSuppressionWithHttpInfo(String suppressionId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'suppressionId' when calling" + + " deleteSecurityMonitoringSuppression"); + } + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a suppression rule. + * + *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. + * + * @param suppressionId The ID of the suppression rule (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteSecurityMonitoringSuppressionWithHttpInfoAsync( + String suppressionId) { + Object localVarPostBody = null; + + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'suppressionId' when calling" + + " deleteSecurityMonitoringSuppression")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Modify the triage assignee of a security signal. + * + *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. + * + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return SecurityMonitoringSignalTriageUpdateResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalAssignee( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) throws ApiException { + return editSecurityMonitoringSignalAssigneeWithHttpInfo(signalId, body).getData(); + } + + /** + * Modify the triage assignee of a security signal. + * + *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfoAsync}. + * + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + */ + public CompletableFuture + editSecurityMonitoringSignalAssigneeAsync( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { + return editSecurityMonitoringSignalAssigneeWithHttpInfoAsync(signalId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Modify the triage assignee of a security signal. + * + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ public ApiResponse - editSecurityMonitoringSignalIncidentsWithHttpInfo( - String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) - throws ApiException { + editSecurityMonitoringSignalAssigneeWithHttpInfo( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'signalId' is set @@ -1905,7 +2305,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal throw new ApiException( 400, "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalIncidents"); + + " editSecurityMonitoringSignalAssignee"); } // verify the required parameter 'body' is set @@ -1913,18 +2313,18 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal throw new ApiException( 400, "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalIncidents"); + + " editSecurityMonitoringSignalAssignee"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/incidents" + "/api/v2/security_monitoring/signals/{signal_id}/assignee" .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", localVarPath, new ArrayList(), localVarHeaderParams, @@ -1943,9 +2343,9 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Change the related incidents of a security signal. + * Modify the triage assignee of a security signal. * - *

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. * * @param signalId The ID of the signal. (required) * @param body Attributes describing the signal update. (required) @@ -1953,8 +2353,8 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> */ public CompletableFuture> - editSecurityMonitoringSignalIncidentsWithHttpInfoAsync( - String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { + editSecurityMonitoringSignalAssigneeWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { Object localVarPostBody = body; // verify the required parameter 'signalId' is set @@ -1965,7 +2365,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal new ApiException( 400, "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalIncidents")); + + " editSecurityMonitoringSignalAssignee")); return result; } @@ -1977,12 +2377,12 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal new ApiException( 400, "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalIncidents")); + + " editSecurityMonitoringSignalAssignee")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/incidents" + "/api/v2/security_monitoring/signals/{signal_id}/assignee" .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); @@ -1991,7 +2391,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2016,33 +2416,33 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Change the triage state of a security signal. + * Change the related incidents of a security signal. * - *

See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. * * @param signalId The ID of the signal. (required) * @param body Attributes describing the signal update. (required) * @return SecurityMonitoringSignalTriageUpdateResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalState( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) throws ApiException { - return editSecurityMonitoringSignalStateWithHttpInfo(signalId, body).getData(); + public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalIncidents( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) throws ApiException { + return editSecurityMonitoringSignalIncidentsWithHttpInfo(signalId, body).getData(); } /** - * Change the triage state of a security signal. + * Change the related incidents of a security signal. * - *

See {@link #editSecurityMonitoringSignalStateWithHttpInfoAsync}. + *

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfoAsync}. * * @param signalId The ID of the signal. (required) * @param body Attributes describing the signal update. (required) * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> */ public CompletableFuture - editSecurityMonitoringSignalStateAsync( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) { - return editSecurityMonitoringSignalStateWithHttpInfoAsync(signalId, body) + editSecurityMonitoringSignalIncidentsAsync( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { + return editSecurityMonitoringSignalIncidentsWithHttpInfoAsync(signalId, body) .thenApply( response -> { return response.getData(); @@ -2050,7 +2450,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Change the triage state of a security signal. + * Change the related incidents for a security signal. * * @param signalId The ID of the signal. (required) * @param body Attributes describing the signal update. (required) @@ -2068,8 +2468,9 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal * */ public ApiResponse - editSecurityMonitoringSignalStateWithHttpInfo( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) throws ApiException { + editSecurityMonitoringSignalIncidentsWithHttpInfo( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) + throws ApiException { Object localVarPostBody = body; // verify the required parameter 'signalId' is set @@ -2077,25 +2478,26 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal throw new ApiException( 400, "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalState"); + + " editSecurityMonitoringSignalIncidents"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( 400, - "Missing the required parameter 'body' when calling editSecurityMonitoringSignalState"); + "Missing the required parameter 'body' when calling" + + " editSecurityMonitoringSignalIncidents"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/state" + "/api/v2/security_monitoring/signals/{signal_id}/incidents" .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2114,9 +2516,9 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Change the triage state of a security signal. + * Change the related incidents of a security signal. * - *

See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. * * @param signalId The ID of the signal. (required) * @param body Attributes describing the signal update. (required) @@ -2124,8 +2526,8 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> */ public CompletableFuture> - editSecurityMonitoringSignalStateWithHttpInfoAsync( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) { + editSecurityMonitoringSignalIncidentsWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { Object localVarPostBody = body; // verify the required parameter 'signalId' is set @@ -2136,7 +2538,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal new ApiException( 400, "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalState")); + + " editSecurityMonitoringSignalIncidents")); return result; } @@ -2148,12 +2550,12 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal new ApiException( 400, "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalState")); + + " editSecurityMonitoringSignalIncidents")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/state" + "/api/v2/security_monitoring/signals/{signal_id}/incidents" .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); @@ -2162,7 +2564,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2186,32 +2588,203 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal new GenericType() {}); } - /** Manage optional parameters to getFinding. */ - public static class GetFindingOptionalParameters { - private Long snapshotTimestamp; - - /** - * Set snapshotTimestamp. - * - * @param snapshotTimestamp Return the finding for a given snapshot of time (Unix ms). - * (optional) - * @return GetFindingOptionalParameters - */ - public GetFindingOptionalParameters snapshotTimestamp(Long snapshotTimestamp) { - this.snapshotTimestamp = snapshotTimestamp; - return this; - } - } - /** - * Get a finding. + * Change the triage state of a security signal. * - *

See {@link #getFindingWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. * - * @param findingId The ID of the finding. (required) - * @return GetFindingResponse - * @throws ApiException if fails to make API call - */ + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return SecurityMonitoringSignalTriageUpdateResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalState( + String signalId, SecurityMonitoringSignalStateUpdateRequest body) throws ApiException { + return editSecurityMonitoringSignalStateWithHttpInfo(signalId, body).getData(); + } + + /** + * Change the triage state of a security signal. + * + *

See {@link #editSecurityMonitoringSignalStateWithHttpInfoAsync}. + * + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + */ + public CompletableFuture + editSecurityMonitoringSignalStateAsync( + String signalId, SecurityMonitoringSignalStateUpdateRequest body) { + return editSecurityMonitoringSignalStateWithHttpInfoAsync(signalId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Change the triage state of a security signal. + * + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse + editSecurityMonitoringSignalStateWithHttpInfo( + String signalId, SecurityMonitoringSignalStateUpdateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'signalId' is set + if (signalId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signalId' when calling" + + " editSecurityMonitoringSignalState"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling editSecurityMonitoringSignalState"); + } + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}/state" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Change the triage state of a security signal. + * + *

See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. + * + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> + */ + public CompletableFuture> + editSecurityMonitoringSignalStateWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalStateUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'signalId' when calling" + + " editSecurityMonitoringSignalState")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " editSecurityMonitoringSignalState")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}/state" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getFinding. */ + public static class GetFindingOptionalParameters { + private Long snapshotTimestamp; + + /** + * Set snapshotTimestamp. + * + * @param snapshotTimestamp Return the finding for a given snapshot of time (Unix ms). + * (optional) + * @return GetFindingOptionalParameters + */ + public GetFindingOptionalParameters snapshotTimestamp(Long snapshotTimestamp) { + this.snapshotTimestamp = snapshotTimestamp; + return this; + } + } + + /** + * Get a finding. + * + *

See {@link #getFindingWithHttpInfo}. + * + * @param findingId The ID of the finding. (required) + * @return GetFindingResponse + * @throws ApiException if fails to make API call + */ public GetFindingResponse getFinding(String findingId) throws ApiException { return getFindingWithHttpInfo(findingId, new GetFindingOptionalParameters()).getData(); } @@ -2554,50 +3127,29 @@ public CompletableFuture> getHistoricalJobWit new GenericType() {}); } - /** Manage optional parameters to getSBOM. */ - public static class GetSBOMOptionalParameters { - private String filterRepoDigest; - - /** - * Set filterRepoDigest. - * - * @param filterRepoDigest The container image repo_digest for the SBOM request. - * When the requested asset type is 'Image', this filter is mandatory. (optional) - * @return GetSBOMOptionalParameters - */ - public GetSBOMOptionalParameters filterRepoDigest(String filterRepoDigest) { - this.filterRepoDigest = filterRepoDigest; - return this; - } - } - /** - * Get SBOM. + * Get details of an inbox rule. * - *

See {@link #getSBOMWithHttpInfo}. + *

See {@link #getInboxRuleWithHttpInfo}. * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) - * @return GetSBOMResponse + * @param inboxRuleId ID of the inbox rule (required) + * @return InboxRuleResponse * @throws ApiException if fails to make API call */ - public GetSBOMResponse getSBOM(AssetType assetType, String filterAssetName) throws ApiException { - return getSBOMWithHttpInfo(assetType, filterAssetName, new GetSBOMOptionalParameters()) - .getData(); + public InboxRuleResponse getInboxRule(UUID inboxRuleId) throws ApiException { + return getInboxRuleWithHttpInfo(inboxRuleId).getData(); } /** - * Get SBOM. + * Get details of an inbox rule. * - *

See {@link #getSBOMWithHttpInfoAsync}. + *

See {@link #getInboxRuleWithHttpInfoAsync}. * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) - * @return CompletableFuture<GetSBOMResponse> + * @param inboxRuleId ID of the inbox rule (required) + * @return CompletableFuture<InboxRuleResponse> */ - public CompletableFuture getSBOMAsync( - AssetType assetType, String filterAssetName) { - return getSBOMWithHttpInfoAsync(assetType, filterAssetName, new GetSBOMOptionalParameters()) + public CompletableFuture getInboxRuleAsync(UUID inboxRuleId) { + return getInboxRuleWithHttpInfoAsync(inboxRuleId) .thenApply( response -> { return response.getData(); @@ -2605,106 +3157,48 @@ public CompletableFuture getSBOMAsync( } /** - * Get SBOM. - * - *

See {@link #getSBOMWithHttpInfo}. + * Get the details of an inbox rule. * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) - * @param parameters Optional parameters for the request. - * @return GetSBOMResponse + * @param inboxRuleId ID of the inbox rule (required) + * @return ApiResponse<InboxRuleResponse> * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Inbox rule details -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public GetSBOMResponse getSBOM( - AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) + public ApiResponse getInboxRuleWithHttpInfo(UUID inboxRuleId) throws ApiException { - return getSBOMWithHttpInfo(assetType, filterAssetName, parameters).getData(); - } + Object localVarPostBody = null; - /** - * Get SBOM. - * - *

See {@link #getSBOMWithHttpInfoAsync}. - * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<GetSBOMResponse> - */ - public CompletableFuture getSBOMAsync( - AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) { - return getSBOMWithHttpInfoAsync(assetType, filterAssetName, parameters) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Get a single SBOM related to an asset by its type and name. - * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<GetSBOMResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: asset not found -
429 Too many requests -
- */ - public ApiResponse getSBOMWithHttpInfo( - AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "getSBOM"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } - Object localVarPostBody = null; - - // verify the required parameter 'assetType' is set - if (assetType == null) { - throw new ApiException( - 400, "Missing the required parameter 'assetType' when calling getSBOM"); - } - - // verify the required parameter 'filterAssetName' is set - if (filterAssetName == null) { + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { throw new ApiException( - 400, "Missing the required parameter 'filterAssetName' when calling getSBOM"); + 400, "Missing the required parameter 'inboxRuleId' when calling getInboxRule"); } - String filterRepoDigest = parameters.filterRepoDigest; // create path and map variables String localVarPath = - "/api/v2/security/sboms/{asset_type}" - .replaceAll("\\{" + "asset_type" + "\\}", apiClient.escapeString(assetType.toString())); + "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}" + .replaceAll( + "\\{" + "inbox_rule_id" + "\\}", apiClient.escapeString(inboxRuleId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSBOM", + "v2.SecurityMonitoringApi.getInboxRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -2713,76 +3207,50 @@ public ApiResponse getSBOMWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get SBOM. + * Get details of an inbox rule. * - *

See {@link #getSBOMWithHttpInfo}. + *

See {@link #getInboxRuleWithHttpInfo}. * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<GetSBOMResponse>> + * @param inboxRuleId ID of the inbox rule (required) + * @return CompletableFuture<ApiResponse<InboxRuleResponse>> */ - public CompletableFuture> getSBOMWithHttpInfoAsync( - AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "getSBOM"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> getInboxRuleWithHttpInfoAsync( + UUID inboxRuleId) { Object localVarPostBody = null; - // verify the required parameter 'assetType' is set - if (assetType == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'assetType' when calling getSBOM")); - return result; - } - - // verify the required parameter 'filterAssetName' is set - if (filterAssetName == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'filterAssetName' when calling getSBOM")); + 400, "Missing the required parameter 'inboxRuleId' when calling getInboxRule")); return result; } - String filterRepoDigest = parameters.filterRepoDigest; // create path and map variables String localVarPath = - "/api/v2/security/sboms/{asset_type}" - .replaceAll("\\{" + "asset_type" + "\\}", apiClient.escapeString(assetType.toString())); + "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}" + .replaceAll( + "\\{" + "inbox_rule_id" + "\\}", apiClient.escapeString(inboxRuleId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSBOM", + "v2.SecurityMonitoringApi.getInboxRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -2794,32 +3262,30 @@ public CompletableFuture> getSBOMWithHttpInfoAsync( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a security filter. + * Get the ordered list of inbox rules. * - *

See {@link #getSecurityFilterWithHttpInfo}. + *

See {@link #getInboxRulesWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) - * @return SecurityFilterResponse + * @return Object * @throws ApiException if fails to make API call */ - public SecurityFilterResponse getSecurityFilter(String securityFilterId) throws ApiException { - return getSecurityFilterWithHttpInfo(securityFilterId).getData(); + public Object getInboxRules() throws ApiException { + return getInboxRulesWithHttpInfo().getData(); } /** - * Get a security filter. + * Get the ordered list of inbox rules. * - *

See {@link #getSecurityFilterWithHttpInfoAsync}. + *

See {@link #getInboxRulesWithHttpInfoAsync}. * - * @param securityFilterId The ID of the security filter. (required) - * @return CompletableFuture<SecurityFilterResponse> + * @return CompletableFuture<Object> */ - public CompletableFuture getSecurityFilterAsync(String securityFilterId) { - return getSecurityFilterWithHttpInfoAsync(securityFilterId) + public CompletableFuture getInboxRulesAsync() { + return getInboxRulesWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -2827,46 +3293,29 @@ public CompletableFuture getSecurityFilterAsync(String s } /** - * Get the details of a specific security filter. - * - *

See the security - * filter guide for more examples. + * Returns the ordered list of inbox rules in the pipeline (first match applies) * - * @param securityFilterId The ID of the security filter. (required) - * @return ApiResponse<SecurityFilterResponse> + * @return ApiResponse<Object> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
404 Not Found -
200 The list of inbox rules -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse getSecurityFilterWithHttpInfo(String securityFilterId) - throws ApiException { + public ApiResponse getInboxRulesWithHttpInfo() throws ApiException { Object localVarPostBody = null; - - // verify the required parameter 'securityFilterId' is set - if (securityFilterId == null) { - throw new ApiException( - 400, "Missing the required parameter 'securityFilterId' when calling getSecurityFilter"); - } // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityFilter", + "v2.SecurityMonitoringApi.getInboxRules", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2881,36 +3330,20 @@ public ApiResponse getSecurityFilterWithHttpInfo(String localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a security filter. + * Get the ordered list of inbox rules. * - *

See {@link #getSecurityFilterWithHttpInfo}. + *

See {@link #getInboxRulesWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) - * @return CompletableFuture<ApiResponse<SecurityFilterResponse>> + * @return CompletableFuture<ApiResponse<Object>> */ - public CompletableFuture> getSecurityFilterWithHttpInfoAsync( - String securityFilterId) { + public CompletableFuture> getInboxRulesWithHttpInfoAsync() { Object localVarPostBody = null; - - // verify the required parameter 'securityFilterId' is set - if (securityFilterId == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'securityFilterId' when calling getSecurityFilter")); - return result; - } // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules"; Map localVarHeaderParams = new HashMap(); @@ -2918,7 +3351,7 @@ public CompletableFuture> getSecurityFilterW try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityFilter", + "v2.SecurityMonitoringApi.getInboxRules", localVarPath, new ArrayList(), localVarHeaderParams, @@ -2926,7 +3359,7 @@ public CompletableFuture> getSecurityFilterW new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -2938,34 +3371,32 @@ public CompletableFuture> getSecurityFilterW localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a rule's details. + * Get details of a mute rule. * - *

See {@link #getSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #getMuteRuleWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @return SecurityMonitoringRuleResponse + * @param muteRuleId ID of the mute rule (required) + * @return MuteRuleResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringRuleResponse getSecurityMonitoringRule(String ruleId) - throws ApiException { - return getSecurityMonitoringRuleWithHttpInfo(ruleId).getData(); + public MuteRuleResponse getMuteRule(UUID muteRuleId) throws ApiException { + return getMuteRuleWithHttpInfo(muteRuleId).getData(); } /** - * Get a rule's details. + * Get details of a mute rule. * - *

See {@link #getSecurityMonitoringRuleWithHttpInfoAsync}. + *

See {@link #getMuteRuleWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) - * @return CompletableFuture<SecurityMonitoringRuleResponse> + * @param muteRuleId ID of the mute rule (required) + * @return CompletableFuture<MuteRuleResponse> */ - public CompletableFuture getSecurityMonitoringRuleAsync( - String ruleId) { - return getSecurityMonitoringRuleWithHttpInfoAsync(ruleId) + public CompletableFuture getMuteRuleAsync(UUID muteRuleId) { + return getMuteRuleWithHttpInfoAsync(muteRuleId) .thenApply( response -> { return response.getData(); @@ -2973,39 +3404,42 @@ public CompletableFuture getSecurityMonitoringRu } /** - * Get a rule's details. + * Get the details of a mute rule. * - * @param ruleId The ID of the rule. (required) - * @return ApiResponse<SecurityMonitoringRuleResponse> + * @param muteRuleId ID of the mute rule (required) + * @return ApiResponse<MuteRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
200 Mute rule details -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSecurityMonitoringRuleWithHttpInfo( - String ruleId) throws ApiException { + public ApiResponse getMuteRuleWithHttpInfo(UUID muteRuleId) + throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'ruleId' is set - if (ruleId == null) { + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { throw new ApiException( - 400, "Missing the required parameter 'ruleId' when calling getSecurityMonitoringRule"); + 400, "Missing the required parameter 'muteRuleId' when calling getMuteRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringRule", + "v2.SecurityMonitoringApi.getMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3020,35 +3454,34 @@ public ApiResponse getSecurityMonitoringRuleWith localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a rule's details. + * Get details of a mute rule. * - *

See {@link #getSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #getMuteRuleWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleResponse>> + * @param muteRuleId ID of the mute rule (required) + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> */ - public CompletableFuture> - getSecurityMonitoringRuleWithHttpInfoAsync(String ruleId) { + public CompletableFuture> getMuteRuleWithHttpInfoAsync( + UUID muteRuleId) { Object localVarPostBody = null; - // verify the required parameter 'ruleId' is set - if (ruleId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'ruleId' when calling getSecurityMonitoringRule")); + 400, "Missing the required parameter 'muteRuleId' when calling getMuteRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -3056,7 +3489,7 @@ public ApiResponse getSecurityMonitoringRuleWith try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringRule", + "v2.SecurityMonitoringApi.getMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3064,8 +3497,7 @@ public ApiResponse getSecurityMonitoringRuleWith new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -3077,34 +3509,30 @@ public ApiResponse getSecurityMonitoringRuleWith localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a signal's details. + * Get the ordered list of mute rules. * - *

See {@link #getSecurityMonitoringSignalWithHttpInfo}. + *

See {@link #getMuteRulesWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @return SecurityMonitoringSignalResponse + * @return Object * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalResponse getSecurityMonitoringSignal(String signalId) - throws ApiException { - return getSecurityMonitoringSignalWithHttpInfo(signalId).getData(); + public Object getMuteRules() throws ApiException { + return getMuteRulesWithHttpInfo().getData(); } /** - * Get a signal's details. + * Get the ordered list of mute rules. * - *

See {@link #getSecurityMonitoringSignalWithHttpInfoAsync}. + *

See {@link #getMuteRulesWithHttpInfoAsync}. * - * @param signalId The ID of the signal. (required) - * @return CompletableFuture<SecurityMonitoringSignalResponse> + * @return CompletableFuture<Object> */ - public CompletableFuture getSecurityMonitoringSignalAsync( - String signalId) { - return getSecurityMonitoringSignalWithHttpInfoAsync(signalId) + public CompletableFuture getMuteRulesAsync() { + return getMuteRulesWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -3112,40 +3540,29 @@ public CompletableFuture getSecurityMonitoring } /** - * Get a signal's details. + * Returns the ordered list of mute rules in the pipeline (first match applies) * - * @param signalId The ID of the signal. (required) - * @return ApiResponse<SecurityMonitoringSignalResponse> + * @return ApiResponse<Object> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
404 Not Found -
200 The list of mute rules -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse getSecurityMonitoringSignalWithHttpInfo( - String signalId) throws ApiException { + public ApiResponse getMuteRulesWithHttpInfo() throws ApiException { Object localVarPostBody = null; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signalId' when calling getSecurityMonitoringSignal"); - } // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringSignal", + "v2.SecurityMonitoringApi.getMuteRules", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3160,36 +3577,20 @@ public ApiResponse getSecurityMonitoringSignal localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a signal's details. + * Get the ordered list of mute rules. * - *

See {@link #getSecurityMonitoringSignalWithHttpInfo}. + *

See {@link #getMuteRulesWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalResponse>> + * @return CompletableFuture<ApiResponse<Object>> */ - public CompletableFuture> - getSecurityMonitoringSignalWithHttpInfoAsync(String signalId) { + public CompletableFuture> getMuteRulesWithHttpInfoAsync() { Object localVarPostBody = null; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'signalId' when calling" - + " getSecurityMonitoringSignal")); - return result; - } // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules"; Map localVarHeaderParams = new HashMap(); @@ -3197,7 +3598,7 @@ public ApiResponse getSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringSignal", + "v2.SecurityMonitoringApi.getMuteRules", localVarPath, new ArrayList(), localVarHeaderParams, @@ -3205,8 +3606,7 @@ public ApiResponse getSecurityMonitoringSignal new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -3218,34 +3618,53 @@ public ApiResponse getSecurityMonitoringSignal localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getSBOM. */ + public static class GetSBOMOptionalParameters { + private String filterRepoDigest; + + /** + * Set filterRepoDigest. + * + * @param filterRepoDigest The container image repo_digest for the SBOM request. + * When the requested asset type is 'Image', this filter is mandatory. (optional) + * @return GetSBOMOptionalParameters + */ + public GetSBOMOptionalParameters filterRepoDigest(String filterRepoDigest) { + this.filterRepoDigest = filterRepoDigest; + return this; + } } /** - * Get a suppression rule. + * Get SBOM. * - *

See {@link #getSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #getSBOMWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) - * @return SecurityMonitoringSuppressionResponse + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) + * @return GetSBOMResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( - String suppressionId) throws ApiException { - return getSecurityMonitoringSuppressionWithHttpInfo(suppressionId).getData(); + public GetSBOMResponse getSBOM(AssetType assetType, String filterAssetName) throws ApiException { + return getSBOMWithHttpInfo(assetType, filterAssetName, new GetSBOMOptionalParameters()) + .getData(); } /** - * Get a suppression rule. + * Get SBOM. * - *

See {@link #getSecurityMonitoringSuppressionWithHttpInfoAsync}. + *

See {@link #getSBOMWithHttpInfoAsync}. * - * @param suppressionId The ID of the suppression rule (required) - * @return CompletableFuture<SecurityMonitoringSuppressionResponse> + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) + * @return CompletableFuture<GetSBOMResponse> */ - public CompletableFuture - getSecurityMonitoringSuppressionAsync(String suppressionId) { - return getSecurityMonitoringSuppressionWithHttpInfoAsync(suppressionId) + public CompletableFuture getSBOMAsync( + AssetType assetType, String filterAssetName) { + return getSBOMWithHttpInfoAsync(assetType, filterAssetName, new GetSBOMOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -3253,49 +3672,106 @@ public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( } /** - * Get the details of a specific suppression rule. + * Get SBOM. * - * @param suppressionId The ID of the suppression rule (required) - * @return ApiResponse<SecurityMonitoringSuppressionResponse> + *

See {@link #getSBOMWithHttpInfo}. + * + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) + * @param parameters Optional parameters for the request. + * @return GetSBOMResponse + * @throws ApiException if fails to make API call + */ + public GetSBOMResponse getSBOM( + AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) + throws ApiException { + return getSBOMWithHttpInfo(assetType, filterAssetName, parameters).getData(); + } + + /** + * Get SBOM. + * + *

See {@link #getSBOMWithHttpInfoAsync}. + * + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<GetSBOMResponse> + */ + public CompletableFuture getSBOMAsync( + AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) { + return getSBOMWithHttpInfoAsync(assetType, filterAssetName, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single SBOM related to an asset by its type and name. + * + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<GetSBOMResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
404 Not Found -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: asset not found -
429 Too many requests -
*/ - public ApiResponse - getSecurityMonitoringSuppressionWithHttpInfo(String suppressionId) throws ApiException { + public ApiResponse getSBOMWithHttpInfo( + AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getSBOM"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { + // verify the required parameter 'assetType' is set + if (assetType == null) { throw new ApiException( - 400, - "Missing the required parameter 'suppressionId' when calling" - + " getSecurityMonitoringSuppression"); + 400, "Missing the required parameter 'assetType' when calling getSBOM"); + } + + // verify the required parameter 'filterAssetName' is set + if (filterAssetName == null) { + throw new ApiException( + 400, "Missing the required parameter 'filterAssetName' when calling getSBOM"); } + String filterRepoDigest = parameters.filterRepoDigest; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" - .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "/api/v2/security/sboms/{asset_type}" + .replaceAll("\\{" + "asset_type" + "\\}", apiClient.escapeString(assetType.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.getSBOM", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -3304,54 +3780,76 @@ public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a suppression rule. + * Get SBOM. * - *

See {@link #getSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #getSBOMWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionResponse>> + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<GetSBOMResponse>> */ - public CompletableFuture> - getSecurityMonitoringSuppressionWithHttpInfoAsync(String suppressionId) { + public CompletableFuture> getSBOMWithHttpInfoAsync( + AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getSBOM"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'assetType' is set + if (assetType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'assetType' when calling getSBOM")); + return result; + } + + // verify the required parameter 'filterAssetName' is set + if (filterAssetName == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'suppressionId' when calling" - + " getSecurityMonitoringSuppression")); + 400, "Missing the required parameter 'filterAssetName' when calling getSBOM")); return result; } + String filterRepoDigest = parameters.filterRepoDigest; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" - .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "/api/v2/security/sboms/{asset_type}" + .replaceAll("\\{" + "asset_type" + "\\}", apiClient.escapeString(assetType.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.getSBOM", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -3363,200 +3861,32 @@ public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to listFindings. */ - public static class ListFindingsOptionalParameters { - private Long pageLimit; - private Long snapshotTimestamp; - private String pageCursor; - private String filterTags; - private String filterEvaluationChangedAt; - private Boolean filterMuted; - private String filterRuleId; - private String filterRuleName; - private String filterResourceType; - private String filterDiscoveryTimestamp; - private FindingEvaluation filterEvaluation; - private FindingStatus filterStatus; - private List filterVulnerabilityType; - - /** - * Set pageLimit. - * - * @param pageLimit Limit the number of findings returned. Must be <= 1000. (optional, - * default to 100) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters pageLimit(Long pageLimit) { - this.pageLimit = pageLimit; - return this; - } - - /** - * Set snapshotTimestamp. - * - * @param snapshotTimestamp Return findings for a given snapshot of time (Unix ms). (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters snapshotTimestamp(Long snapshotTimestamp) { - this.snapshotTimestamp = snapshotTimestamp; - return this; - } - - /** - * Set pageCursor. - * - * @param pageCursor Return the next page of findings pointed to by the cursor. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters pageCursor(String pageCursor) { - this.pageCursor = pageCursor; - return this; - } - - /** - * Set filterTags. - * - * @param filterTags Return findings that have these associated tags (repeatable). (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterTags(String filterTags) { - this.filterTags = filterTags; - return this; - } - - /** - * Set filterEvaluationChangedAt. - * - * @param filterEvaluationChangedAt Return findings that have changed from pass to fail or vice - * versa on a specified date (Unix ms) or date range (using comparison operators). - * (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterEvaluationChangedAt( - String filterEvaluationChangedAt) { - this.filterEvaluationChangedAt = filterEvaluationChangedAt; - return this; - } - - /** - * Set filterMuted. - * - * @param filterMuted Set to true to return findings that are muted. Set to - * false to return unmuted findings. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterMuted(Boolean filterMuted) { - this.filterMuted = filterMuted; - return this; - } - - /** - * Set filterRuleId. - * - * @param filterRuleId Return findings for the specified rule ID. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterRuleId(String filterRuleId) { - this.filterRuleId = filterRuleId; - return this; - } - - /** - * Set filterRuleName. - * - * @param filterRuleName Return findings for the specified rule. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterRuleName(String filterRuleName) { - this.filterRuleName = filterRuleName; - return this; - } - - /** - * Set filterResourceType. - * - * @param filterResourceType Return only findings for the specified resource type. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterResourceType(String filterResourceType) { - this.filterResourceType = filterResourceType; - return this; - } - - /** - * Set filterDiscoveryTimestamp. - * - * @param filterDiscoveryTimestamp Return findings that were found on a specified date (Unix ms) - * or date range (using comparison operators). (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterDiscoveryTimestamp( - String filterDiscoveryTimestamp) { - this.filterDiscoveryTimestamp = filterDiscoveryTimestamp; - return this; - } - - /** - * Set filterEvaluation. - * - * @param filterEvaluation Return only pass or fail findings. - * (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterEvaluation(FindingEvaluation filterEvaluation) { - this.filterEvaluation = filterEvaluation; - return this; - } - - /** - * Set filterStatus. - * - * @param filterStatus Return only findings with the specified status. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterStatus(FindingStatus filterStatus) { - this.filterStatus = filterStatus; - return this; - } - - /** - * Set filterVulnerabilityType. - * - * @param filterVulnerabilityType Return findings that match the selected vulnerability types - * (repeatable). (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterVulnerabilityType( - List filterVulnerabilityType) { - this.filterVulnerabilityType = filterVulnerabilityType; - return this; - } + new GenericType() {}); } /** - * List findings. + * Get a security filter. * - *

See {@link #listFindingsWithHttpInfo}. + *

See {@link #getSecurityFilterWithHttpInfo}. * - * @return ListFindingsResponse + * @param securityFilterId The ID of the security filter. (required) + * @return SecurityFilterResponse * @throws ApiException if fails to make API call */ - public ListFindingsResponse listFindings() throws ApiException { - return listFindingsWithHttpInfo(new ListFindingsOptionalParameters()).getData(); + public SecurityFilterResponse getSecurityFilter(String securityFilterId) throws ApiException { + return getSecurityFilterWithHttpInfo(securityFilterId).getData(); } /** - * List findings. + * Get a security filter. * - *

See {@link #listFindingsWithHttpInfoAsync}. + *

See {@link #getSecurityFilterWithHttpInfoAsync}. * - * @return CompletableFuture<ListFindingsResponse> + * @param securityFilterId The ID of the security filter. (required) + * @return CompletableFuture<SecurityFilterResponse> */ - public CompletableFuture listFindingsAsync() { - return listFindingsWithHttpInfoAsync(new ListFindingsOptionalParameters()) + public CompletableFuture getSecurityFilterAsync(String securityFilterId) { + return getSecurityFilterWithHttpInfoAsync(securityFilterId) .thenApply( response -> { return response.getData(); @@ -3564,210 +3894,187 @@ public CompletableFuture listFindingsAsync() { } /** - * List findings. + * Get the details of a specific security filter. * - *

See {@link #listFindingsWithHttpInfo}. + *

See the security + * filter guide for more examples. * - * @param parameters Optional parameters for the request. - * @return ListFindingsResponse + * @param securityFilterId The ID of the security filter. (required) + * @return ApiResponse<SecurityFilterResponse> * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ListFindingsResponse listFindings(ListFindingsOptionalParameters parameters) + public ApiResponse getSecurityFilterWithHttpInfo(String securityFilterId) throws ApiException { - return listFindingsWithHttpInfo(parameters).getData(); - } + Object localVarPostBody = null; - /** - * List findings. - * - *

See {@link #listFindingsWithHttpInfoAsync}. - * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListFindingsResponse> - */ - public CompletableFuture listFindingsAsync( - ListFindingsOptionalParameters parameters) { - return listFindingsWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { + throw new ApiException( + 400, "Missing the required parameter 'securityFilterId' when calling getSecurityFilter"); + } + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" + .replaceAll( + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getSecurityFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * List findings. + * Get a security filter. * - *

See {@link #listFindingsWithHttpInfo}. + *

See {@link #getSecurityFilterWithHttpInfo}. * - * @return PaginationIterable<Finding> + * @param securityFilterId The ID of the security filter. (required) + * @return CompletableFuture<ApiResponse<SecurityFilterResponse>> */ - public PaginationIterable listFindingsWithPagination() { - ListFindingsOptionalParameters parameters = new ListFindingsOptionalParameters(); - return listFindingsWithPagination(parameters); - } + public CompletableFuture> getSecurityFilterWithHttpInfoAsync( + String securityFilterId) { + Object localVarPostBody = null; - /** - * List findings. - * - *

See {@link #listFindingsWithHttpInfo}. - * - * @return ListFindingsResponse - */ - public PaginationIterable listFindingsWithPagination( - ListFindingsOptionalParameters parameters) { - String resultsPath = "getData"; - String valueGetterPath = "getMeta.getPage.getCursor"; - String valueSetterPath = "pageCursor"; - Boolean valueSetterParamOptional = true; - Long limit; - - if (parameters.pageLimit == null) { - limit = 100l; - parameters.pageLimit(limit); - } else { - limit = parameters.pageLimit; + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'securityFilterId' when calling getSecurityFilter")); + return result; } + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" + .replaceAll( + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); - LinkedHashMap args = new LinkedHashMap(); - args.put("optionalParams", parameters); - - PaginationIterable iterator = - new PaginationIterable( - this, - "listFindings", - resultsPath, - valueGetterPath, - valueSetterPath, - valueSetterParamOptional, - true, - limit, - args); + Map localVarHeaderParams = new HashMap(); - return iterator; + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getSecurityFilter", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * Get a list of findings. These include both misconfigurations and identity risks. - * - *

Note: To filter and return only identity risks, add the following query - * parameter: ?filter[tags]=dd_rule_type:ciem - * - *

Filtering

- * - *

Filters can be applied by appending query parameters to the URL. - * - *

    - *
  • Using a single filter: ?filter[attribute_key]=attribute_value - *
  • Chaining filters: - * ?filter[attribute_key]=attribute_value&filter[attribute_key]=attribute_value... - * - *
  • Filtering on tags: - * ?filter[tags]=tag_key:tag_value&filter[tags]=tag_key_2:tag_value_2 - *
- * - *

Here, attribute_key can be any of the filter keys described further below. - * - *

Query parameters of type integer support comparison operators (> - * , >=, <, <=). This is particularly - * useful when filtering by evaluation_changed_at or - * resource_discovery_timestamp. For example: - * ?filter[evaluation_changed_at]=>20123123121. - * - *

You can also use the negation operator on strings. For example, use - * filter[resource_type]=-aws* to filter for any non-AWS resources. - * - *

The operator must come after the equal sign. For example, to filter with the >= - * operator, add the operator after the equal sign: - * filter[evaluation_changed_at]=>=1678809373257. - * - *

Query parameters must be only among the documented ones and with values of correct types. - * Duplicated query parameters (e.g. filter[status]=low&filter[status]=info) are - * not allowed. + * Get a rule's details. * - *

Response

+ *

See {@link #getSecurityMonitoringRuleWithHttpInfo}. * - *

The response includes an array of finding objects, pagination metadata, and a count of items - * that match the query. + * @param ruleId The ID of the rule. (required) + * @return SecurityMonitoringRuleResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringRuleResponse getSecurityMonitoringRule(String ruleId) + throws ApiException { + return getSecurityMonitoringRuleWithHttpInfo(ruleId).getData(); + } + + /** + * Get a rule's details. * - *

Each finding object contains the following: + *

See {@link #getSecurityMonitoringRuleWithHttpInfoAsync}. * - *

    - *
  • The finding ID that can be used in a GetFinding request to retrieve the full - * finding details. - *
  • Core attributes, including status, evaluation, high-level resource details, muted state, - * and rule details. - *
  • evaluation_changed_at and resource_discovery_date time stamps. - *
  • An array of associated tags. - *
+ * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<SecurityMonitoringRuleResponse> + */ + public CompletableFuture getSecurityMonitoringRuleAsync( + String ruleId) { + return getSecurityMonitoringRuleWithHttpInfoAsync(ruleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a rule's details. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<ListFindingsResponse> + * @param ruleId The ID of the rule. (required) + * @return ApiResponse<SecurityMonitoringRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * - * - * + * + * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not Found: The requested finding cannot be found. -
429 Too many requests: The rate limit set by the API has been exceeded. -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse listFindingsWithHttpInfo( - ListFindingsOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listFindings"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } + public ApiResponse getSecurityMonitoringRuleWithHttpInfo( + String ruleId) throws ApiException { Object localVarPostBody = null; - Long pageLimit = parameters.pageLimit; - Long snapshotTimestamp = parameters.snapshotTimestamp; - String pageCursor = parameters.pageCursor; - String filterTags = parameters.filterTags; - String filterEvaluationChangedAt = parameters.filterEvaluationChangedAt; - Boolean filterMuted = parameters.filterMuted; - String filterRuleId = parameters.filterRuleId; - String filterRuleName = parameters.filterRuleName; - String filterResourceType = parameters.filterResourceType; - String filterDiscoveryTimestamp = parameters.filterDiscoveryTimestamp; - FindingEvaluation filterEvaluation = parameters.filterEvaluation; - FindingStatus filterStatus = parameters.filterStatus; - List filterVulnerabilityType = parameters.filterVulnerabilityType; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'ruleId' when calling getSecurityMonitoringRule"); + } // create path and map variables - String localVarPath = "/api/v2/posture_management/findings"; + String localVarPath = + "/api/v2/security_monitoring/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[evaluation_changed_at]", filterEvaluationChangedAt)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[muted]", filterMuted)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_id]", filterRuleId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_name]", filterRuleName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[resource_type]", filterResourceType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[discovery_timestamp]", filterDiscoveryTimestamp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[evaluation]", filterEvaluation)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("multi", "filter[vulnerability_type]", filterVulnerabilityType)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listFindings", + "v2.SecurityMonitoringApi.getSecurityMonitoringRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -3780,82 +4087,52 @@ public ApiResponse listFindingsWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List findings. + * Get a rule's details. * - *

See {@link #listFindingsWithHttpInfo}. + *

See {@link #getSecurityMonitoringRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ListFindingsResponse>> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleResponse>> */ - public CompletableFuture> listFindingsWithHttpInfoAsync( - ListFindingsOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "listFindings"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> + getSecurityMonitoringRuleWithHttpInfoAsync(String ruleId) { + Object localVarPostBody = null; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling getSecurityMonitoringRule")); return result; } - Object localVarPostBody = null; - Long pageLimit = parameters.pageLimit; - Long snapshotTimestamp = parameters.snapshotTimestamp; - String pageCursor = parameters.pageCursor; - String filterTags = parameters.filterTags; - String filterEvaluationChangedAt = parameters.filterEvaluationChangedAt; - Boolean filterMuted = parameters.filterMuted; - String filterRuleId = parameters.filterRuleId; - String filterRuleName = parameters.filterRuleName; - String filterResourceType = parameters.filterResourceType; - String filterDiscoveryTimestamp = parameters.filterDiscoveryTimestamp; - FindingEvaluation filterEvaluation = parameters.filterEvaluation; - FindingStatus filterStatus = parameters.filterStatus; - List filterVulnerabilityType = parameters.filterVulnerabilityType; // create path and map variables - String localVarPath = "/api/v2/posture_management/findings"; + String localVarPath = + "/api/v2/security_monitoring/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[evaluation_changed_at]", filterEvaluationChangedAt)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[muted]", filterMuted)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_id]", filterRuleId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_name]", filterRuleName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[resource_type]", filterResourceType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[discovery_timestamp]", filterDiscoveryTimestamp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[evaluation]", filterEvaluation)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("multi", "filter[vulnerability_type]", filterVulnerabilityType)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listFindings", + "v2.SecurityMonitoringApi.getSecurityMonitoringRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -3867,114 +4144,34 @@ public CompletableFuture> listFindingsWithHttp localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to listHistoricalJobs. */ - public static class ListHistoricalJobsOptionalParameters { - private Long pageSize; - private Long pageNumber; - private String sort; - private String filterQuery; - - /** - * Set pageSize. - * - * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default - * to 10) - * @return ListHistoricalJobsOptionalParameters - */ - public ListHistoricalJobsOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; - return this; - } - - /** - * Set pageNumber. - * - * @param pageNumber Specific page number to return. (optional, default to 0) - * @return ListHistoricalJobsOptionalParameters - */ - public ListHistoricalJobsOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; - return this; - } - - /** - * Set sort. - * - * @param sort The order of the jobs in results. (optional) - * @return ListHistoricalJobsOptionalParameters - */ - public ListHistoricalJobsOptionalParameters sort(String sort) { - this.sort = sort; - return this; - } - - /** - * Set filterQuery. - * - * @param filterQuery Query used to filter items from the fetched list. (optional) - * @return ListHistoricalJobsOptionalParameters - */ - public ListHistoricalJobsOptionalParameters filterQuery(String filterQuery) { - this.filterQuery = filterQuery; - return this; - } - } - - /** - * List historical jobs. - * - *

See {@link #listHistoricalJobsWithHttpInfo}. - * - * @return ListHistoricalJobsResponse - * @throws ApiException if fails to make API call - */ - public ListHistoricalJobsResponse listHistoricalJobs() throws ApiException { - return listHistoricalJobsWithHttpInfo(new ListHistoricalJobsOptionalParameters()).getData(); - } - - /** - * List historical jobs. - * - *

See {@link #listHistoricalJobsWithHttpInfoAsync}. - * - * @return CompletableFuture<ListHistoricalJobsResponse> - */ - public CompletableFuture listHistoricalJobsAsync() { - return listHistoricalJobsWithHttpInfoAsync(new ListHistoricalJobsOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType() {}); } /** - * List historical jobs. + * Get a signal's details. * - *

See {@link #listHistoricalJobsWithHttpInfo}. + *

See {@link #getSecurityMonitoringSignalWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return ListHistoricalJobsResponse + * @param signalId The ID of the signal. (required) + * @return SecurityMonitoringSignalResponse * @throws ApiException if fails to make API call */ - public ListHistoricalJobsResponse listHistoricalJobs( - ListHistoricalJobsOptionalParameters parameters) throws ApiException { - return listHistoricalJobsWithHttpInfo(parameters).getData(); + public SecurityMonitoringSignalResponse getSecurityMonitoringSignal(String signalId) + throws ApiException { + return getSecurityMonitoringSignalWithHttpInfo(signalId).getData(); } /** - * List historical jobs. + * Get a signal's details. * - *

See {@link #listHistoricalJobsWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringSignalWithHttpInfoAsync}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListHistoricalJobsResponse> + * @param signalId The ID of the signal. (required) + * @return CompletableFuture<SecurityMonitoringSignalResponse> */ - public CompletableFuture listHistoricalJobsAsync( - ListHistoricalJobsOptionalParameters parameters) { - return listHistoricalJobsWithHttpInfoAsync(parameters) + public CompletableFuture getSecurityMonitoringSignalAsync( + String signalId) { + return getSecurityMonitoringSignalWithHttpInfoAsync(signalId) .thenApply( response -> { return response.getData(); @@ -3982,51 +4179,42 @@ public CompletableFuture listHistoricalJobsAsync( } /** - * List historical jobs. + * Get a signal's details. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<ListHistoricalJobsResponse> + * @param signalId The ID of the signal. (required) + * @return ApiResponse<SecurityMonitoringSignalResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse listHistoricalJobsWithHttpInfo( - ListHistoricalJobsOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listHistoricalJobs"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } + public ApiResponse getSecurityMonitoringSignalWithHttpInfo( + String signalId) throws ApiException { Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - String sort = parameters.sort; - String filterQuery = parameters.filterQuery; + + // verify the required parameter 'signalId' is set + if (signalId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'signalId' when calling getSecurityMonitoringSignal"); + } // create path and map variables - String localVarPath = "/api/v2/siem-historical-detections/jobs"; + String localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listHistoricalJobs", + "v2.SecurityMonitoringApi.getSecurityMonitoringSignal", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -4039,58 +4227,53 @@ public ApiResponse listHistoricalJobsWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List historical jobs. + * Get a signal's details. * - *

See {@link #listHistoricalJobsWithHttpInfo}. + *

See {@link #getSecurityMonitoringSignalWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ListHistoricalJobsResponse>> + * @param signalId The ID of the signal. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalResponse>> */ - public CompletableFuture> - listHistoricalJobsWithHttpInfoAsync(ListHistoricalJobsOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "listHistoricalJobs"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> + getSecurityMonitoringSignalWithHttpInfoAsync(String signalId) { + Object localVarPostBody = null; + + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, + "Missing the required parameter 'signalId' when calling" + + " getSecurityMonitoringSignal")); return result; } - Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - String sort = parameters.sort; - String filterQuery = parameters.filterQuery; // create path and map variables - String localVarPath = "/api/v2/siem-historical-detections/jobs"; + String localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listHistoricalJobs", + "v2.SecurityMonitoringApi.getSecurityMonitoringSignal", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4102,30 +4285,34 @@ public ApiResponse listHistoricalJobsWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all security filters. + * Get a suppression rule. * - *

See {@link #listSecurityFiltersWithHttpInfo}. + *

See {@link #getSecurityMonitoringSuppressionWithHttpInfo}. * - * @return SecurityFiltersResponse - * @throws ApiException if fails to make API call + * @param suppressionId The ID of the suppression rule (required) + * @return SecurityMonitoringSuppressionResponse + * @throws ApiException if fails to make API call */ - public SecurityFiltersResponse listSecurityFilters() throws ApiException { - return listSecurityFiltersWithHttpInfo().getData(); + public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( + String suppressionId) throws ApiException { + return getSecurityMonitoringSuppressionWithHttpInfo(suppressionId).getData(); } /** - * Get all security filters. + * Get a suppression rule. * - *

See {@link #listSecurityFiltersWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringSuppressionWithHttpInfoAsync}. * - * @return CompletableFuture<SecurityFiltersResponse> + * @param suppressionId The ID of the suppression rule (required) + * @return CompletableFuture<SecurityMonitoringSuppressionResponse> */ - public CompletableFuture listSecurityFiltersAsync() { - return listSecurityFiltersWithHttpInfoAsync() + public CompletableFuture + getSecurityMonitoringSuppressionAsync(String suppressionId) { + return getSecurityMonitoringSuppressionWithHttpInfoAsync(suppressionId) .thenApply( response -> { return response.getData(); @@ -4133,9 +4320,10 @@ public CompletableFuture listSecurityFiltersAsync() { } /** - * Get the list of configured security filters with their definitions. + * Get the details of a specific suppression rule. * - * @return ApiResponse<SecurityFiltersResponse> + * @param suppressionId The ID of the suppression rule (required) + * @return ApiResponse<SecurityMonitoringSuppressionResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -4143,20 +4331,32 @@ public CompletableFuture listSecurityFiltersAsync() { * * * + * * *
Status Code Description Response Headers
200 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse listSecurityFiltersWithHttpInfo() - throws ApiException { + public ApiResponse + getSecurityMonitoringSuppressionWithHttpInfo(String suppressionId) throws ApiException { Object localVarPostBody = null; + + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'suppressionId' when calling" + + " getSecurityMonitoringSuppression"); + } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/security_filters"; + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityFilters", + "v2.SecurityMonitoringApi.getSecurityMonitoringSuppression", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4171,21 +4371,37 @@ public ApiResponse listSecurityFiltersWithHttpInfo() localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all security filters. + * Get a suppression rule. * - *

See {@link #listSecurityFiltersWithHttpInfo}. + *

See {@link #getSecurityMonitoringSuppressionWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<SecurityFiltersResponse>> + * @param suppressionId The ID of the suppression rule (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionResponse>> */ - public CompletableFuture> - listSecurityFiltersWithHttpInfoAsync() { + public CompletableFuture> + getSecurityMonitoringSuppressionWithHttpInfoAsync(String suppressionId) { Object localVarPostBody = null; + + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'suppressionId' when calling" + + " getSecurityMonitoringSuppression")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/security_filters"; + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); Map localVarHeaderParams = new HashMap(); @@ -4193,7 +4409,7 @@ public ApiResponse listSecurityFiltersWithHttpInfo() try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityFilters", + "v2.SecurityMonitoringApi.getSecurityMonitoringSuppression", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4201,7 +4417,8 @@ public ApiResponse listSecurityFiltersWithHttpInfo() new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4213,303 +4430,200 @@ public ApiResponse listSecurityFiltersWithHttpInfo() localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listSecurityMonitoringRules. */ - public static class ListSecurityMonitoringRulesOptionalParameters { - private Long pageSize; - private Long pageNumber; + /** Manage optional parameters to listFindings. */ + public static class ListFindingsOptionalParameters { + private Long pageLimit; + private Long snapshotTimestamp; + private String pageCursor; + private String filterTags; + private String filterEvaluationChangedAt; + private Boolean filterMuted; + private String filterRuleId; + private String filterRuleName; + private String filterResourceType; + private String filterDiscoveryTimestamp; + private FindingEvaluation filterEvaluation; + private FindingStatus filterStatus; + private List filterVulnerabilityType; /** - * Set pageSize. + * Set pageLimit. * - * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default - * to 10) - * @return ListSecurityMonitoringRulesOptionalParameters + * @param pageLimit Limit the number of findings returned. Must be <= 1000. (optional, + * default to 100) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringRulesOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; + public ListFindingsOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; return this; } /** - * Set pageNumber. + * Set snapshotTimestamp. * - * @param pageNumber Specific page number to return. (optional, default to 0) - * @return ListSecurityMonitoringRulesOptionalParameters + * @param snapshotTimestamp Return findings for a given snapshot of time (Unix ms). (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringRulesOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; + public ListFindingsOptionalParameters snapshotTimestamp(Long snapshotTimestamp) { + this.snapshotTimestamp = snapshotTimestamp; return this; } - } - - /** - * List rules. - * - *

See {@link #listSecurityMonitoringRulesWithHttpInfo}. - * - * @return SecurityMonitoringListRulesResponse - * @throws ApiException if fails to make API call - */ - public SecurityMonitoringListRulesResponse listSecurityMonitoringRules() throws ApiException { - return listSecurityMonitoringRulesWithHttpInfo( - new ListSecurityMonitoringRulesOptionalParameters()) - .getData(); - } - - /** - * List rules. - * - *

See {@link #listSecurityMonitoringRulesWithHttpInfoAsync}. - * - * @return CompletableFuture<SecurityMonitoringListRulesResponse> - */ - public CompletableFuture listSecurityMonitoringRulesAsync() { - return listSecurityMonitoringRulesWithHttpInfoAsync( - new ListSecurityMonitoringRulesOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * List rules. - * - *

See {@link #listSecurityMonitoringRulesWithHttpInfo}. - * - * @param parameters Optional parameters for the request. - * @return SecurityMonitoringListRulesResponse - * @throws ApiException if fails to make API call - */ - public SecurityMonitoringListRulesResponse listSecurityMonitoringRules( - ListSecurityMonitoringRulesOptionalParameters parameters) throws ApiException { - return listSecurityMonitoringRulesWithHttpInfo(parameters).getData(); - } - /** - * List rules. - * - *

See {@link #listSecurityMonitoringRulesWithHttpInfoAsync}. - * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringListRulesResponse> - */ - public CompletableFuture listSecurityMonitoringRulesAsync( - ListSecurityMonitoringRulesOptionalParameters parameters) { - return listSecurityMonitoringRulesWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); - } + /** + * Set pageCursor. + * + * @param pageCursor Return the next page of findings pointed to by the cursor. (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; + return this; + } - /** - * List rules. - * - * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringListRulesResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
- */ - public ApiResponse listSecurityMonitoringRulesWithHttpInfo( - ListSecurityMonitoringRulesOptionalParameters parameters) throws ApiException { - Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules"; + /** + * Set filterTags. + * + * @param filterTags Return findings that have these associated tags (repeatable). (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterTags(String filterTags) { + this.filterTags = filterTags; + return this; + } - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); + /** + * Set filterEvaluationChangedAt. + * + * @param filterEvaluationChangedAt Return findings that have changed from pass to fail or vice + * versa on a specified date (Unix ms) or date range (using comparison operators). + * (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterEvaluationChangedAt( + String filterEvaluationChangedAt) { + this.filterEvaluationChangedAt = filterEvaluationChangedAt; + return this; + } - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + /** + * Set filterMuted. + * + * @param filterMuted Set to true to return findings that are muted. Set to + * false to return unmuted findings. (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterMuted(Boolean filterMuted) { + this.filterMuted = filterMuted; + return this; + } - Invocation.Builder builder = - apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringRules", - localVarPath, - localVarQueryParams, - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * List rules. - * - *

See {@link #listSecurityMonitoringRulesWithHttpInfo}. - * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SecurityMonitoringListRulesResponse>> - */ - public CompletableFuture> - listSecurityMonitoringRulesWithHttpInfoAsync( - ListSecurityMonitoringRulesOptionalParameters parameters) { - Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules"; - - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringRules", - localVarPath, - localVarQueryParams, - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); - } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; + /** + * Set filterRuleId. + * + * @param filterRuleId Return findings for the specified rule ID. (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterRuleId(String filterRuleId) { + this.filterRuleId = filterRuleId; + return this; } - return apiClient.invokeAPIAsync( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** Manage optional parameters to listSecurityMonitoringSignals. */ - public static class ListSecurityMonitoringSignalsOptionalParameters { - private String filterQuery; - private OffsetDateTime filterFrom; - private OffsetDateTime filterTo; - private SecurityMonitoringSignalsSort sort; - private String pageCursor; - private Integer pageLimit; /** - * Set filterQuery. + * Set filterRuleName. * - * @param filterQuery The search query for security signals. (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters + * @param filterRuleName Return findings for the specified rule. (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringSignalsOptionalParameters filterQuery(String filterQuery) { - this.filterQuery = filterQuery; + public ListFindingsOptionalParameters filterRuleName(String filterRuleName) { + this.filterRuleName = filterRuleName; return this; } /** - * Set filterFrom. + * Set filterResourceType. * - * @param filterFrom The minimum timestamp for requested security signals. (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters + * @param filterResourceType Return only findings for the specified resource type. (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringSignalsOptionalParameters filterFrom(OffsetDateTime filterFrom) { - this.filterFrom = filterFrom; + public ListFindingsOptionalParameters filterResourceType(String filterResourceType) { + this.filterResourceType = filterResourceType; return this; } /** - * Set filterTo. + * Set filterDiscoveryTimestamp. * - * @param filterTo The maximum timestamp for requested security signals. (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters + * @param filterDiscoveryTimestamp Return findings that were found on a specified date (Unix ms) + * or date range (using comparison operators). (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringSignalsOptionalParameters filterTo(OffsetDateTime filterTo) { - this.filterTo = filterTo; + public ListFindingsOptionalParameters filterDiscoveryTimestamp( + String filterDiscoveryTimestamp) { + this.filterDiscoveryTimestamp = filterDiscoveryTimestamp; return this; } /** - * Set sort. + * Set filterEvaluation. * - * @param sort The order of the security signals in results. (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters + * @param filterEvaluation Return only pass or fail findings. + * (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringSignalsOptionalParameters sort( - SecurityMonitoringSignalsSort sort) { - this.sort = sort; + public ListFindingsOptionalParameters filterEvaluation(FindingEvaluation filterEvaluation) { + this.filterEvaluation = filterEvaluation; return this; } /** - * Set pageCursor. + * Set filterStatus. * - * @param pageCursor A list of results using the cursor provided in the previous query. - * (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters + * @param filterStatus Return only findings with the specified status. (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringSignalsOptionalParameters pageCursor(String pageCursor) { - this.pageCursor = pageCursor; + public ListFindingsOptionalParameters filterStatus(FindingStatus filterStatus) { + this.filterStatus = filterStatus; return this; } /** - * Set pageLimit. + * Set filterVulnerabilityType. * - * @param pageLimit The maximum number of security signals in the response. (optional, default - * to 10) - * @return ListSecurityMonitoringSignalsOptionalParameters + * @param filterVulnerabilityType Return findings that match the selected vulnerability types + * (repeatable). (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringSignalsOptionalParameters pageLimit(Integer pageLimit) { - this.pageLimit = pageLimit; + public ListFindingsOptionalParameters filterVulnerabilityType( + List filterVulnerabilityType) { + this.filterVulnerabilityType = filterVulnerabilityType; return this; } } /** - * Get a quick list of security signals. + * List findings. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #listFindingsWithHttpInfo}. * - * @return SecurityMonitoringSignalsListResponse + * @return ListFindingsResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals() throws ApiException { - return listSecurityMonitoringSignalsWithHttpInfo( - new ListSecurityMonitoringSignalsOptionalParameters()) - .getData(); + public ListFindingsResponse listFindings() throws ApiException { + return listFindingsWithHttpInfo(new ListFindingsOptionalParameters()).getData(); } /** - * Get a quick list of security signals. + * List findings. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfoAsync}. + *

See {@link #listFindingsWithHttpInfoAsync}. * - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + * @return CompletableFuture<ListFindingsResponse> */ - public CompletableFuture - listSecurityMonitoringSignalsAsync() { - return listSecurityMonitoringSignalsWithHttpInfoAsync( - new ListSecurityMonitoringSignalsOptionalParameters()) + public CompletableFuture listFindingsAsync() { + return listFindingsWithHttpInfoAsync(new ListFindingsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -4517,31 +4631,30 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals() thr } /** - * Get a quick list of security signals. + * List findings. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #listFindingsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return SecurityMonitoringSignalsListResponse + * @return ListFindingsResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals( - ListSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { - return listSecurityMonitoringSignalsWithHttpInfo(parameters).getData(); + public ListFindingsResponse listFindings(ListFindingsOptionalParameters parameters) + throws ApiException { + return listFindingsWithHttpInfo(parameters).getData(); } /** - * Get a quick list of security signals. + * List findings. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfoAsync}. + *

See {@link #listFindingsWithHttpInfoAsync}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + * @return CompletableFuture<ListFindingsResponse> */ - public CompletableFuture - listSecurityMonitoringSignalsAsync( - ListSecurityMonitoringSignalsOptionalParameters parameters) { - return listSecurityMonitoringSignalsWithHttpInfoAsync(parameters) + public CompletableFuture listFindingsAsync( + ListFindingsOptionalParameters parameters) { + return listFindingsWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -4549,36 +4662,34 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals( } /** - * Get a quick list of security signals. + * List findings. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #listFindingsWithHttpInfo}. * - * @return PaginationIterable<SecurityMonitoringSignal> + * @return PaginationIterable<Finding> */ - public PaginationIterable - listSecurityMonitoringSignalsWithPagination() { - ListSecurityMonitoringSignalsOptionalParameters parameters = - new ListSecurityMonitoringSignalsOptionalParameters(); - return listSecurityMonitoringSignalsWithPagination(parameters); + public PaginationIterable listFindingsWithPagination() { + ListFindingsOptionalParameters parameters = new ListFindingsOptionalParameters(); + return listFindingsWithPagination(parameters); } /** - * Get a quick list of security signals. + * List findings. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #listFindingsWithHttpInfo}. * - * @return SecurityMonitoringSignalsListResponse + * @return ListFindingsResponse */ - public PaginationIterable listSecurityMonitoringSignalsWithPagination( - ListSecurityMonitoringSignalsOptionalParameters parameters) { + public PaginationIterable listFindingsWithPagination( + ListFindingsOptionalParameters parameters) { String resultsPath = "getData"; - String valueGetterPath = "getMeta.getPage.getAfter"; + String valueGetterPath = "getMeta.getPage.getCursor"; String valueSetterPath = "pageCursor"; Boolean valueSetterParamOptional = true; - Integer limit; + Long limit; if (parameters.pageLimit == null) { - limit = 10; + limit = 100l; parameters.pageLimit(limit); } else { limit = parameters.pageLimit; @@ -4590,7 +4701,7 @@ public PaginationIterable listSecurityMonitoringSignal PaginationIterable iterator = new PaginationIterable( this, - "listSecurityMonitoringSignals", + "listFindings", resultsPath, valueGetterPath, valueSetterPath, @@ -4603,48 +4714,125 @@ public PaginationIterable listSecurityMonitoringSignal } /** - * The list endpoint returns security signals that match a search query. Both this endpoint and - * the POST endpoint can be used interchangeably when listing security signals. + * Get a list of findings. These include both misconfigurations and identity risks. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringSignalsListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
- */ - public ApiResponse - listSecurityMonitoringSignalsWithHttpInfo( - ListSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { - Object localVarPostBody = null; - String filterQuery = parameters.filterQuery; - OffsetDateTime filterFrom = parameters.filterFrom; - OffsetDateTime filterTo = parameters.filterTo; - SecurityMonitoringSignalsSort sort = parameters.sort; + *

Note: To filter and return only identity risks, add the following query + * parameter: ?filter[tags]=dd_rule_type:ciem + * + *

Filtering

+ * + *

Filters can be applied by appending query parameters to the URL. + * + *

    + *
  • Using a single filter: ?filter[attribute_key]=attribute_value + *
  • Chaining filters: + * ?filter[attribute_key]=attribute_value&filter[attribute_key]=attribute_value... + * + *
  • Filtering on tags: + * ?filter[tags]=tag_key:tag_value&filter[tags]=tag_key_2:tag_value_2 + *
+ * + *

Here, attribute_key can be any of the filter keys described further below. + * + *

Query parameters of type integer support comparison operators (> + * , >=, <, <=). This is particularly + * useful when filtering by evaluation_changed_at or + * resource_discovery_timestamp. For example: + * ?filter[evaluation_changed_at]=>20123123121. + * + *

You can also use the negation operator on strings. For example, use + * filter[resource_type]=-aws* to filter for any non-AWS resources. + * + *

The operator must come after the equal sign. For example, to filter with the >= + * operator, add the operator after the equal sign: + * filter[evaluation_changed_at]=>=1678809373257. + * + *

Query parameters must be only among the documented ones and with values of correct types. + * Duplicated query parameters (e.g. filter[status]=low&filter[status]=info) are + * not allowed. + * + *

Response

+ * + *

The response includes an array of finding objects, pagination metadata, and a count of items + * that match the query. + * + *

Each finding object contains the following: + * + *

    + *
  • The finding ID that can be used in a GetFinding request to retrieve the full + * finding details. + *
  • Core attributes, including status, evaluation, high-level resource details, muted state, + * and rule details. + *
  • evaluation_changed_at and resource_discovery_date time stamps. + *
  • An array of associated tags. + *
+ * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListFindingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not Found: The requested finding cannot be found. -
429 Too many requests: The rate limit set by the API has been exceeded. -
+ */ + public ApiResponse listFindingsWithHttpInfo( + ListFindingsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listFindings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Long pageLimit = parameters.pageLimit; + Long snapshotTimestamp = parameters.snapshotTimestamp; String pageCursor = parameters.pageCursor; - Integer pageLimit = parameters.pageLimit; + String filterTags = parameters.filterTags; + String filterEvaluationChangedAt = parameters.filterEvaluationChangedAt; + Boolean filterMuted = parameters.filterMuted; + String filterRuleId = parameters.filterRuleId; + String filterRuleName = parameters.filterRuleName; + String filterResourceType = parameters.filterResourceType; + String filterDiscoveryTimestamp = parameters.filterDiscoveryTimestamp; + FindingEvaluation filterEvaluation = parameters.filterEvaluation; + FindingStatus filterStatus = parameters.filterStatus; + List filterVulnerabilityType = parameters.filterVulnerabilityType; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/signals"; + String localVarPath = "/api/v2/posture_management/findings"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[evaluation_changed_at]", filterEvaluationChangedAt)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[muted]", filterMuted)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_id]", filterRuleId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_name]", filterRuleName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[resource_type]", filterResourceType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[discovery_timestamp]", filterDiscoveryTimestamp)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[evaluation]", filterEvaluation)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[vulnerability_type]", filterVulnerabilityType)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringSignals", + "v2.SecurityMonitoringApi.listFindings", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -4659,45 +4847,74 @@ public PaginationIterable listSecurityMonitoringSignal localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a quick list of security signals. + * List findings. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #listFindingsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> + * @return CompletableFuture<ApiResponse<ListFindingsResponse>> */ - public CompletableFuture> - listSecurityMonitoringSignalsWithHttpInfoAsync( - ListSecurityMonitoringSignalsOptionalParameters parameters) { + public CompletableFuture> listFindingsWithHttpInfoAsync( + ListFindingsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listFindings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - String filterQuery = parameters.filterQuery; - OffsetDateTime filterFrom = parameters.filterFrom; - OffsetDateTime filterTo = parameters.filterTo; - SecurityMonitoringSignalsSort sort = parameters.sort; + Long pageLimit = parameters.pageLimit; + Long snapshotTimestamp = parameters.snapshotTimestamp; String pageCursor = parameters.pageCursor; - Integer pageLimit = parameters.pageLimit; + String filterTags = parameters.filterTags; + String filterEvaluationChangedAt = parameters.filterEvaluationChangedAt; + Boolean filterMuted = parameters.filterMuted; + String filterRuleId = parameters.filterRuleId; + String filterRuleName = parameters.filterRuleName; + String filterResourceType = parameters.filterResourceType; + String filterDiscoveryTimestamp = parameters.filterDiscoveryTimestamp; + FindingEvaluation filterEvaluation = parameters.filterEvaluation; + FindingStatus filterStatus = parameters.filterStatus; + List filterVulnerabilityType = parameters.filterVulnerabilityType; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/signals"; + String localVarPath = "/api/v2/posture_management/findings"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[evaluation_changed_at]", filterEvaluationChangedAt)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[muted]", filterMuted)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_id]", filterRuleId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_name]", filterRuleName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[resource_type]", filterResourceType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[discovery_timestamp]", filterDiscoveryTimestamp)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[evaluation]", filterEvaluation)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("multi", "filter[vulnerability_type]", filterVulnerabilityType)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringSignals", + "v2.SecurityMonitoringApi.listFindings", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -4705,8 +4922,7 @@ public PaginationIterable listSecurityMonitoringSignal new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4718,32 +4934,83 @@ public PaginationIterable listSecurityMonitoringSignal localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to listHistoricalJobs. */ + public static class ListHistoricalJobsOptionalParameters { + private Long pageSize; + private Long pageNumber; + private String sort; + private String filterQuery; + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return ListHistoricalJobsOptionalParameters + */ + public ListHistoricalJobsOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return ListHistoricalJobsOptionalParameters + */ + public ListHistoricalJobsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set sort. + * + * @param sort The order of the jobs in results. (optional) + * @return ListHistoricalJobsOptionalParameters + */ + public ListHistoricalJobsOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set filterQuery. + * + * @param filterQuery Query used to filter items from the fetched list. (optional) + * @return ListHistoricalJobsOptionalParameters + */ + public ListHistoricalJobsOptionalParameters filterQuery(String filterQuery) { + this.filterQuery = filterQuery; + return this; + } } /** - * Get all suppression rules. + * List historical jobs. * - *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfo}. + *

See {@link #listHistoricalJobsWithHttpInfo}. * - * @return SecurityMonitoringSuppressionsResponse + * @return ListHistoricalJobsResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSuppressionsResponse listSecurityMonitoringSuppressions() - throws ApiException { - return listSecurityMonitoringSuppressionsWithHttpInfo().getData(); + public ListHistoricalJobsResponse listHistoricalJobs() throws ApiException { + return listHistoricalJobsWithHttpInfo(new ListHistoricalJobsOptionalParameters()).getData(); } /** - * Get all suppression rules. + * List historical jobs. * - *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfoAsync}. + *

See {@link #listHistoricalJobsWithHttpInfoAsync}. * - * @return CompletableFuture<SecurityMonitoringSuppressionsResponse> + * @return CompletableFuture<ListHistoricalJobsResponse> */ - public CompletableFuture - listSecurityMonitoringSuppressionsAsync() { - return listSecurityMonitoringSuppressionsWithHttpInfoAsync() + public CompletableFuture listHistoricalJobsAsync() { + return listHistoricalJobsWithHttpInfoAsync(new ListHistoricalJobsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -4751,32 +5018,82 @@ public SecurityMonitoringSuppressionsResponse listSecurityMonitoringSuppressions } /** - * Get the list of all suppression rules. + * List historical jobs. * - * @return ApiResponse<SecurityMonitoringSuppressionsResponse> + *

See {@link #listHistoricalJobsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ListHistoricalJobsResponse + * @throws ApiException if fails to make API call + */ + public ListHistoricalJobsResponse listHistoricalJobs( + ListHistoricalJobsOptionalParameters parameters) throws ApiException { + return listHistoricalJobsWithHttpInfo(parameters).getData(); + } + + /** + * List historical jobs. + * + *

See {@link #listHistoricalJobsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListHistoricalJobsResponse> + */ + public CompletableFuture listHistoricalJobsAsync( + ListHistoricalJobsOptionalParameters parameters) { + return listHistoricalJobsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List historical jobs. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListHistoricalJobsResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
*/ - public ApiResponse - listSecurityMonitoringSuppressionsWithHttpInfo() throws ApiException { + public ApiResponse listHistoricalJobsWithHttpInfo( + ListHistoricalJobsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listHistoricalJobs"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String sort = parameters.sort; + String filterQuery = parameters.filterQuery; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; + String localVarPath = "/api/v2/siem-historical-detections/jobs"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringSuppressions", + "v2.SecurityMonitoringApi.listHistoricalJobs", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -4789,38 +5106,58 @@ public SecurityMonitoringSuppressionsResponse listSecurityMonitoringSuppressions localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all suppression rules. + * List historical jobs. * - *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfo}. + *

See {@link #listHistoricalJobsWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionsResponse>> + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListHistoricalJobsResponse>> */ - public CompletableFuture> - listSecurityMonitoringSuppressionsWithHttpInfoAsync() { + public CompletableFuture> + listHistoricalJobsWithHttpInfoAsync(ListHistoricalJobsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listHistoricalJobs"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String sort = parameters.sort; + String filterQuery = parameters.filterQuery; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; + String localVarPath = "/api/v2/siem-historical-detections/jobs"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringSuppressions", + "v2.SecurityMonitoringApi.listHistoricalJobs", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4832,553 +5169,414 @@ public SecurityMonitoringSuppressionsResponse listSecurityMonitoringSuppressions localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listVulnerabilities. */ - public static class ListVulnerabilitiesOptionalParameters { - private String pageToken; - private Long pageNumber; - private VulnerabilityType filterType; - private Double filterCvssBaseScoreOp; - private VulnerabilitySeverity filterCvssBaseSeverity; - private String filterCvssBaseVector; - private Double filterCvssDatadogScoreOp; - private VulnerabilitySeverity filterCvssDatadogSeverity; - private String filterCvssDatadogVector; - private VulnerabilityStatus filterStatus; - private VulnerabilityTool filterTool; - private String filterLibraryName; - private String filterLibraryVersion; - private String filterAdvisoryId; - private Boolean filterRisksExploitationProbability; - private Boolean filterRisksPocExploitAvailable; - private Boolean filterRisksExploitAvailable; - private Double filterRisksEpssScoreOp; - private VulnerabilitySeverity filterRisksEpssSeverity; - private String filterLanguage; - private VulnerabilityEcosystem filterEcosystem; - private String filterCodeLocationLocation; - private String filterCodeLocationFilePath; - private String filterCodeLocationMethod; - private Boolean filterFixAvailable; - private String filterRepoDigests; - private String filterAssetName; - private AssetType filterAssetType; - private String filterAssetVersionFirst; - private String filterAssetVersionLast; - private String filterAssetRepositoryUrl; - private Boolean filterAssetRisksInProduction; - private Boolean filterAssetRisksUnderAttack; - private Boolean filterAssetRisksIsPubliclyAccessible; - private Boolean filterAssetRisksHasPrivilegedAccess; - private Boolean filterAssetRisksHasAccessToSensitiveData; - private String filterAssetEnvironments; - private String filterAssetArch; - private String filterAssetOperatingSystemName; - private String filterAssetOperatingSystemVersion; - - /** - * Set pageToken. - * - * @param pageToken Its value must come from the links section of the response of - * the first request. Do not manually edit it. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters pageToken(String pageToken) { - this.pageToken = pageToken; - return this; - } + /** + * Get all security filters. + * + *

See {@link #listSecurityFiltersWithHttpInfo}. + * + * @return SecurityFiltersResponse + * @throws ApiException if fails to make API call + */ + public SecurityFiltersResponse listSecurityFilters() throws ApiException { + return listSecurityFiltersWithHttpInfo().getData(); + } - /** - * Set pageNumber. - * - * @param pageNumber The page number to be retrieved. It should be equal or greater than 1 - * (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; - return this; - } + /** + * Get all security filters. + * + *

See {@link #listSecurityFiltersWithHttpInfoAsync}. + * + * @return CompletableFuture<SecurityFiltersResponse> + */ + public CompletableFuture listSecurityFiltersAsync() { + return listSecurityFiltersWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } - /** - * Set filterType. - * - * @param filterType Filter by vulnerability type. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterType(VulnerabilityType filterType) { - this.filterType = filterType; - return this; - } + /** + * Get the list of configured security filters with their definitions. + * + * @return ApiResponse<SecurityFiltersResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse listSecurityFiltersWithHttpInfo() + throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/security_filters"; - /** - * Set filterCvssBaseScoreOp. - * - * @param filterCvssBaseScoreOp Filter by vulnerability base (i.e. from the original advisory) - * severity score. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssBaseScoreOp( - Double filterCvssBaseScoreOp) { - this.filterCvssBaseScoreOp = filterCvssBaseScoreOp; - return this; - } + Map localVarHeaderParams = new HashMap(); - /** - * Set filterCvssBaseSeverity. - * - * @param filterCvssBaseSeverity Filter by vulnerability base severity. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssBaseSeverity( - VulnerabilitySeverity filterCvssBaseSeverity) { - this.filterCvssBaseSeverity = filterCvssBaseSeverity; - return this; - } - - /** - * Set filterCvssBaseVector. - * - * @param filterCvssBaseVector Filter by vulnerability base CVSS vector. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssBaseVector(String filterCvssBaseVector) { - this.filterCvssBaseVector = filterCvssBaseVector; - return this; - } - - /** - * Set filterCvssDatadogScoreOp. - * - * @param filterCvssDatadogScoreOp Filter by vulnerability Datadog severity score. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssDatadogScoreOp( - Double filterCvssDatadogScoreOp) { - this.filterCvssDatadogScoreOp = filterCvssDatadogScoreOp; - return this; - } + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFilters", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } - /** - * Set filterCvssDatadogSeverity. - * - * @param filterCvssDatadogSeverity Filter by vulnerability Datadog severity. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssDatadogSeverity( - VulnerabilitySeverity filterCvssDatadogSeverity) { - this.filterCvssDatadogSeverity = filterCvssDatadogSeverity; - return this; - } + /** + * Get all security filters. + * + *

See {@link #listSecurityFiltersWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<SecurityFiltersResponse>> + */ + public CompletableFuture> + listSecurityFiltersWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/security_filters"; - /** - * Set filterCvssDatadogVector. - * - * @param filterCvssDatadogVector Filter by vulnerability Datadog CVSS vector. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssDatadogVector( - String filterCvssDatadogVector) { - this.filterCvssDatadogVector = filterCvssDatadogVector; - return this; - } + Map localVarHeaderParams = new HashMap(); - /** - * Set filterStatus. - * - * @param filterStatus Filter by the status of the vulnerability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterStatus(VulnerabilityStatus filterStatus) { - this.filterStatus = filterStatus; - return this; + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFilters", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } - /** - * Set filterTool. - * - * @param filterTool Filter by the tool of the vulnerability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterTool(VulnerabilityTool filterTool) { - this.filterTool = filterTool; - return this; - } + /** Manage optional parameters to listSecurityMonitoringRules. */ + public static class ListSecurityMonitoringRulesOptionalParameters { + private Long pageSize; + private Long pageNumber; /** - * Set filterLibraryName. + * Set pageSize. * - * @param filterLibraryName Filter by library name. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return ListSecurityMonitoringRulesOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterLibraryName(String filterLibraryName) { - this.filterLibraryName = filterLibraryName; + public ListSecurityMonitoringRulesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; return this; } /** - * Set filterLibraryVersion. + * Set pageNumber. * - * @param filterLibraryVersion Filter by library version. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return ListSecurityMonitoringRulesOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterLibraryVersion(String filterLibraryVersion) { - this.filterLibraryVersion = filterLibraryVersion; + public ListSecurityMonitoringRulesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; return this; } + } - /** - * Set filterAdvisoryId. - * - * @param filterAdvisoryId Filter by advisory ID. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAdvisoryId(String filterAdvisoryId) { - this.filterAdvisoryId = filterAdvisoryId; - return this; - } + /** + * List rules. + * + *

See {@link #listSecurityMonitoringRulesWithHttpInfo}. + * + * @return SecurityMonitoringListRulesResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringListRulesResponse listSecurityMonitoringRules() throws ApiException { + return listSecurityMonitoringRulesWithHttpInfo( + new ListSecurityMonitoringRulesOptionalParameters()) + .getData(); + } - /** - * Set filterRisksExploitationProbability. - * - * @param filterRisksExploitationProbability Filter by exploitation probability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksExploitationProbability( - Boolean filterRisksExploitationProbability) { - this.filterRisksExploitationProbability = filterRisksExploitationProbability; - return this; - } + /** + * List rules. + * + *

See {@link #listSecurityMonitoringRulesWithHttpInfoAsync}. + * + * @return CompletableFuture<SecurityMonitoringListRulesResponse> + */ + public CompletableFuture listSecurityMonitoringRulesAsync() { + return listSecurityMonitoringRulesWithHttpInfoAsync( + new ListSecurityMonitoringRulesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } - /** - * Set filterRisksPocExploitAvailable. - * - * @param filterRisksPocExploitAvailable Filter by POC exploit availability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksPocExploitAvailable( - Boolean filterRisksPocExploitAvailable) { - this.filterRisksPocExploitAvailable = filterRisksPocExploitAvailable; - return this; - } + /** + * List rules. + * + *

See {@link #listSecurityMonitoringRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return SecurityMonitoringListRulesResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringListRulesResponse listSecurityMonitoringRules( + ListSecurityMonitoringRulesOptionalParameters parameters) throws ApiException { + return listSecurityMonitoringRulesWithHttpInfo(parameters).getData(); + } - /** - * Set filterRisksExploitAvailable. - * - * @param filterRisksExploitAvailable Filter by public exploit availability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksExploitAvailable( - Boolean filterRisksExploitAvailable) { - this.filterRisksExploitAvailable = filterRisksExploitAvailable; - return this; - } + /** + * List rules. + * + *

See {@link #listSecurityMonitoringRulesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SecurityMonitoringListRulesResponse> + */ + public CompletableFuture listSecurityMonitoringRulesAsync( + ListSecurityMonitoringRulesOptionalParameters parameters) { + return listSecurityMonitoringRulesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } - /** - * Set filterRisksEpssScoreOp. - * - * @param filterRisksEpssScoreOp Filter by vulnerability EPSS severity score. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksEpssScoreOp( - Double filterRisksEpssScoreOp) { - this.filterRisksEpssScoreOp = filterRisksEpssScoreOp; - return this; - } + /** + * List rules. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<SecurityMonitoringListRulesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse listSecurityMonitoringRulesWithHttpInfo( + ListSecurityMonitoringRulesOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/rules"; - /** - * Set filterRisksEpssSeverity. - * - * @param filterRisksEpssSeverity Filter by vulnerability EPSS severity. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksEpssSeverity( - VulnerabilitySeverity filterRisksEpssSeverity) { - this.filterRisksEpssSeverity = filterRisksEpssSeverity; - return this; - } + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); - /** - * Set filterLanguage. - * - * @param filterLanguage Filter by language. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterLanguage(String filterLanguage) { - this.filterLanguage = filterLanguage; - return this; - } + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - /** - * Set filterEcosystem. - * - * @param filterEcosystem Filter by ecosystem. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterEcosystem( - VulnerabilityEcosystem filterEcosystem) { - this.filterEcosystem = filterEcosystem; - return this; - } + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } - /** - * Set filterCodeLocationLocation. - * - * @param filterCodeLocationLocation Filter by vulnerability location. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCodeLocationLocation( - String filterCodeLocationLocation) { - this.filterCodeLocationLocation = filterCodeLocationLocation; - return this; - } + /** + * List rules. + * + *

See {@link #listSecurityMonitoringRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SecurityMonitoringListRulesResponse>> + */ + public CompletableFuture> + listSecurityMonitoringRulesWithHttpInfoAsync( + ListSecurityMonitoringRulesOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/rules"; - /** - * Set filterCodeLocationFilePath. - * - * @param filterCodeLocationFilePath Filter by vulnerability file path. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCodeLocationFilePath( - String filterCodeLocationFilePath) { - this.filterCodeLocationFilePath = filterCodeLocationFilePath; - return this; - } + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); - /** - * Set filterCodeLocationMethod. - * - * @param filterCodeLocationMethod Filter by method. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCodeLocationMethod( - String filterCodeLocationMethod) { - this.filterCodeLocationMethod = filterCodeLocationMethod; - return this; - } + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - /** - * Set filterFixAvailable. - * - * @param filterFixAvailable Filter by fix availability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterFixAvailable(Boolean filterFixAvailable) { - this.filterFixAvailable = filterFixAvailable; - return this; + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSecurityMonitoringSignals. */ + public static class ListSecurityMonitoringSignalsOptionalParameters { + private String filterQuery; + private OffsetDateTime filterFrom; + private OffsetDateTime filterTo; + private SecurityMonitoringSignalsSort sort; + private String pageCursor; + private Integer pageLimit; /** - * Set filterRepoDigests. + * Set filterQuery. * - * @param filterRepoDigests Filter by vulnerability repo_digest (when the - * vulnerability is related to Image asset). (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param filterQuery The search query for security signals. (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterRepoDigests(String filterRepoDigests) { - this.filterRepoDigests = filterRepoDigests; + public ListSecurityMonitoringSignalsOptionalParameters filterQuery(String filterQuery) { + this.filterQuery = filterQuery; return this; } /** - * Set filterAssetName. + * Set filterFrom. * - * @param filterAssetName Filter by asset name. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param filterFrom The minimum timestamp for requested security signals. (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterAssetName(String filterAssetName) { - this.filterAssetName = filterAssetName; + public ListSecurityMonitoringSignalsOptionalParameters filterFrom(OffsetDateTime filterFrom) { + this.filterFrom = filterFrom; return this; } /** - * Set filterAssetType. + * Set filterTo. * - * @param filterAssetType Filter by asset type. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param filterTo The maximum timestamp for requested security signals. (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterAssetType(AssetType filterAssetType) { - this.filterAssetType = filterAssetType; + public ListSecurityMonitoringSignalsOptionalParameters filterTo(OffsetDateTime filterTo) { + this.filterTo = filterTo; return this; } /** - * Set filterAssetVersionFirst. + * Set sort. * - * @param filterAssetVersionFirst Filter by the first version of the asset this vulnerability - * has been detected on. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param sort The order of the security signals in results. (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterAssetVersionFirst( - String filterAssetVersionFirst) { - this.filterAssetVersionFirst = filterAssetVersionFirst; + public ListSecurityMonitoringSignalsOptionalParameters sort( + SecurityMonitoringSignalsSort sort) { + this.sort = sort; return this; } /** - * Set filterAssetVersionLast. + * Set pageCursor. * - * @param filterAssetVersionLast Filter by the last version of the asset this vulnerability has - * been detected on. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageCursor A list of results using the cursor provided in the previous query. + * (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterAssetVersionLast( - String filterAssetVersionLast) { - this.filterAssetVersionLast = filterAssetVersionLast; + public ListSecurityMonitoringSignalsOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; return this; } /** - * Set filterAssetRepositoryUrl. + * Set pageLimit. * - * @param filterAssetRepositoryUrl Filter by the repository url associated to the asset. - * (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageLimit The maximum number of security signals in the response. (optional, default + * to 10) + * @return ListSecurityMonitoringSignalsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterAssetRepositoryUrl( - String filterAssetRepositoryUrl) { - this.filterAssetRepositoryUrl = filterAssetRepositoryUrl; + public ListSecurityMonitoringSignalsOptionalParameters pageLimit(Integer pageLimit) { + this.pageLimit = pageLimit; return this; } - - /** - * Set filterAssetRisksInProduction. - * - * @param filterAssetRisksInProduction Filter whether the asset is in production or not. - * (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksInProduction( - Boolean filterAssetRisksInProduction) { - this.filterAssetRisksInProduction = filterAssetRisksInProduction; - return this; - } - - /** - * Set filterAssetRisksUnderAttack. - * - * @param filterAssetRisksUnderAttack Filter whether the asset is under attack or not. - * (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksUnderAttack( - Boolean filterAssetRisksUnderAttack) { - this.filterAssetRisksUnderAttack = filterAssetRisksUnderAttack; - return this; - } - - /** - * Set filterAssetRisksIsPubliclyAccessible. - * - * @param filterAssetRisksIsPubliclyAccessible Filter whether the asset is publicly accessible - * or not. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksIsPubliclyAccessible( - Boolean filterAssetRisksIsPubliclyAccessible) { - this.filterAssetRisksIsPubliclyAccessible = filterAssetRisksIsPubliclyAccessible; - return this; - } - - /** - * Set filterAssetRisksHasPrivilegedAccess. - * - * @param filterAssetRisksHasPrivilegedAccess Filter whether the asset is publicly accessible or - * not. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksHasPrivilegedAccess( - Boolean filterAssetRisksHasPrivilegedAccess) { - this.filterAssetRisksHasPrivilegedAccess = filterAssetRisksHasPrivilegedAccess; - return this; - } - - /** - * Set filterAssetRisksHasAccessToSensitiveData. - * - * @param filterAssetRisksHasAccessToSensitiveData Filter whether the asset has access to - * sensitive data or not. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksHasAccessToSensitiveData( - Boolean filterAssetRisksHasAccessToSensitiveData) { - this.filterAssetRisksHasAccessToSensitiveData = filterAssetRisksHasAccessToSensitiveData; - return this; - } - - /** - * Set filterAssetEnvironments. - * - * @param filterAssetEnvironments Filter by asset environments. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetEnvironments( - String filterAssetEnvironments) { - this.filterAssetEnvironments = filterAssetEnvironments; - return this; - } - - /** - * Set filterAssetArch. - * - * @param filterAssetArch Filter by asset architecture. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetArch(String filterAssetArch) { - this.filterAssetArch = filterAssetArch; - return this; - } - - /** - * Set filterAssetOperatingSystemName. - * - * @param filterAssetOperatingSystemName Filter by asset operating system name. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetOperatingSystemName( - String filterAssetOperatingSystemName) { - this.filterAssetOperatingSystemName = filterAssetOperatingSystemName; - return this; - } - - /** - * Set filterAssetOperatingSystemVersion. - * - * @param filterAssetOperatingSystemVersion Filter by asset operating system version. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetOperatingSystemVersion( - String filterAssetOperatingSystemVersion) { - this.filterAssetOperatingSystemVersion = filterAssetOperatingSystemVersion; - return this; - } - } + } /** - * List vulnerabilities. + * Get a quick list of security signals. * - *

See {@link #listVulnerabilitiesWithHttpInfo}. + *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. * - * @return ListVulnerabilitiesResponse + * @return SecurityMonitoringSignalsListResponse * @throws ApiException if fails to make API call */ - public ListVulnerabilitiesResponse listVulnerabilities() throws ApiException { - return listVulnerabilitiesWithHttpInfo(new ListVulnerabilitiesOptionalParameters()).getData(); + public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals() throws ApiException { + return listSecurityMonitoringSignalsWithHttpInfo( + new ListSecurityMonitoringSignalsOptionalParameters()) + .getData(); } /** - * List vulnerabilities. + * Get a quick list of security signals. * - *

See {@link #listVulnerabilitiesWithHttpInfoAsync}. + *

See {@link #listSecurityMonitoringSignalsWithHttpInfoAsync}. * - * @return CompletableFuture<ListVulnerabilitiesResponse> + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> */ - public CompletableFuture listVulnerabilitiesAsync() { - return listVulnerabilitiesWithHttpInfoAsync(new ListVulnerabilitiesOptionalParameters()) + public CompletableFuture + listSecurityMonitoringSignalsAsync() { + return listSecurityMonitoringSignalsWithHttpInfoAsync( + new ListSecurityMonitoringSignalsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -5386,30 +5584,31 @@ public CompletableFuture listVulnerabilitiesAsync() } /** - * List vulnerabilities. + * Get a quick list of security signals. * - *

See {@link #listVulnerabilitiesWithHttpInfo}. + *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return ListVulnerabilitiesResponse + * @return SecurityMonitoringSignalsListResponse * @throws ApiException if fails to make API call */ - public ListVulnerabilitiesResponse listVulnerabilities( - ListVulnerabilitiesOptionalParameters parameters) throws ApiException { - return listVulnerabilitiesWithHttpInfo(parameters).getData(); + public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals( + ListSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { + return listSecurityMonitoringSignalsWithHttpInfo(parameters).getData(); } /** - * List vulnerabilities. + * Get a quick list of security signals. * - *

See {@link #listVulnerabilitiesWithHttpInfoAsync}. + *

See {@link #listSecurityMonitoringSignalsWithHttpInfoAsync}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListVulnerabilitiesResponse> + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> */ - public CompletableFuture listVulnerabilitiesAsync( - ListVulnerabilitiesOptionalParameters parameters) { - return listVulnerabilitiesWithHttpInfoAsync(parameters) + public CompletableFuture + listSecurityMonitoringSignalsAsync( + ListSecurityMonitoringSignalsOptionalParameters parameters) { + return listSecurityMonitoringSignalsWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -5417,276 +5616,108 @@ public CompletableFuture listVulnerabilitiesAsync( } /** - * Get a list of vulnerabilities. - * - *

Pagination

- * - *

Pagination is enabled by default in both vulnerabilities and assets - * . The size of the page varies depending on the endpoint and cannot be modified. To - * automate the request of the next page, you can use the links section in the response. - * - *

This endpoint will return paginated responses. The pages are stored in the links section of - * the response: - * - *

JSON - * { - * "data": [...], - * "meta": {...}, - * "links": { - * "self": "https://.../api/v2/security/vulnerabilities", - * "first": "https://.../api/v2/security/vulnerabilities?page[number]=1&page[token]=abc", - * "last": "https://.../api/v2/security/vulnerabilities?page[number]=43&page[token]=abc", - * "next": "https://.../api/v2/security/vulnerabilities?page[number]=2&page[token]=abc" - * } - * } - * - *

    - *
  • links.previous is empty if the first page is requested. - *
  • links.next is empty if the last page is requested. - *
- * - *

Token

- * - *

Vulnerabilities can be created, updated or deleted at any point in time. - * - *

Upon the first request, a token is created to ensure consistency across subsequent paginated - * requests. - * - *

A token is valid only for 24 hours. - * - *

First request

+ * Get a quick list of security signals. * - *

We consider a request to be the first request when there is no page[token] - * parameter. + *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. * - *

The response of this first request contains the newly created token in the links - * section. + * @return PaginationIterable<SecurityMonitoringSignal> + */ + public PaginationIterable + listSecurityMonitoringSignalsWithPagination() { + ListSecurityMonitoringSignalsOptionalParameters parameters = + new ListSecurityMonitoringSignalsOptionalParameters(); + return listSecurityMonitoringSignalsWithPagination(parameters); + } + + /** + * Get a quick list of security signals. * - *

This token can then be used in the subsequent paginated requests. + *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. * - *

Subsequent requests

- * - *

Any request containing valid page[token] and page[number] - * parameters will be considered a subsequent request. - * - *

If the token is invalid, a 404 response will be returned. - * - *

If the page number is invalid, a 400 response will be returned. - * - *

Filtering

- * - *

The request can include some filter parameters to filter the data to be retrieved. The - * format of the filter parameters follows the JSON:API format: - * filter[$prop_name], where prop_name is the property name in the entity - * being filtered by. - * - *

All filters can include multiple values, where data will be filtered with an OR clause: - * filter[title]=Title1,Title2 will filter all vulnerabilities where title is equal - * to Title1 OR Title2. - * - *

String filters are case sensitive. - * - *

Boolean filters accept true or false as values. - * - *

Number filters must include an operator as a second filter input: - * filter[$prop_name][$operator]. For example, for the vulnerabilities endpoint: - * filter[cvss.base.score][lte]=8. - * - *

Available operators are: eq (==), lt (<), lte - * (<=), gt (>) and gte (>=). - * - *

Metadata

- * - *

Following JSON:API format, object - * including non-standard meta-information. - * - *

This endpoint includes the meta member in the response. For more details on each of the - * properties included in this section, check the endpoints response tables. - * - *

JSON - * { - * "data": [...], - * "meta": { - * "total": 1500, - * "count": 18732, - * "token": "some_token" - * }, - * "links": {...} - * } + * @return SecurityMonitoringSignalsListResponse + */ + public PaginationIterable listSecurityMonitoringSignalsWithPagination( + ListSecurityMonitoringSignalsOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = "getMeta.getPage.getAfter"; + String valueSetterPath = "pageCursor"; + Boolean valueSetterParamOptional = true; + Integer limit; + + if (parameters.pageLimit == null) { + limit = 10; + parameters.pageLimit(limit); + } else { + limit = parameters.pageLimit; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "listSecurityMonitoringSignals", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + limit, + args); + + return iterator; + } + + /** + * The list endpoint returns security signals that match a search query. Both this endpoint and + * the POST endpoint can be used interchangeably when listing security signals. * * @param parameters Optional parameters for the request. - * @return ApiResponse<ListVulnerabilitiesResponse> + * @return ApiResponse<SecurityMonitoringSignalsListResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * - * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: There is no request associated with the provided token. -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
*/ - public ApiResponse listVulnerabilitiesWithHttpInfo( - ListVulnerabilitiesOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listVulnerabilities"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } + public ApiResponse + listSecurityMonitoringSignalsWithHttpInfo( + ListSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; - String pageToken = parameters.pageToken; - Long pageNumber = parameters.pageNumber; - VulnerabilityType filterType = parameters.filterType; - Double filterCvssBaseScoreOp = parameters.filterCvssBaseScoreOp; - VulnerabilitySeverity filterCvssBaseSeverity = parameters.filterCvssBaseSeverity; - String filterCvssBaseVector = parameters.filterCvssBaseVector; - Double filterCvssDatadogScoreOp = parameters.filterCvssDatadogScoreOp; - VulnerabilitySeverity filterCvssDatadogSeverity = parameters.filterCvssDatadogSeverity; - String filterCvssDatadogVector = parameters.filterCvssDatadogVector; - VulnerabilityStatus filterStatus = parameters.filterStatus; - VulnerabilityTool filterTool = parameters.filterTool; - String filterLibraryName = parameters.filterLibraryName; - String filterLibraryVersion = parameters.filterLibraryVersion; - String filterAdvisoryId = parameters.filterAdvisoryId; - Boolean filterRisksExploitationProbability = parameters.filterRisksExploitationProbability; - Boolean filterRisksPocExploitAvailable = parameters.filterRisksPocExploitAvailable; - Boolean filterRisksExploitAvailable = parameters.filterRisksExploitAvailable; - Double filterRisksEpssScoreOp = parameters.filterRisksEpssScoreOp; - VulnerabilitySeverity filterRisksEpssSeverity = parameters.filterRisksEpssSeverity; - String filterLanguage = parameters.filterLanguage; - VulnerabilityEcosystem filterEcosystem = parameters.filterEcosystem; - String filterCodeLocationLocation = parameters.filterCodeLocationLocation; - String filterCodeLocationFilePath = parameters.filterCodeLocationFilePath; - String filterCodeLocationMethod = parameters.filterCodeLocationMethod; - Boolean filterFixAvailable = parameters.filterFixAvailable; - String filterRepoDigests = parameters.filterRepoDigests; - String filterAssetName = parameters.filterAssetName; - AssetType filterAssetType = parameters.filterAssetType; - String filterAssetVersionFirst = parameters.filterAssetVersionFirst; - String filterAssetVersionLast = parameters.filterAssetVersionLast; - String filterAssetRepositoryUrl = parameters.filterAssetRepositoryUrl; - Boolean filterAssetRisksInProduction = parameters.filterAssetRisksInProduction; - Boolean filterAssetRisksUnderAttack = parameters.filterAssetRisksUnderAttack; - Boolean filterAssetRisksIsPubliclyAccessible = parameters.filterAssetRisksIsPubliclyAccessible; - Boolean filterAssetRisksHasPrivilegedAccess = parameters.filterAssetRisksHasPrivilegedAccess; - Boolean filterAssetRisksHasAccessToSensitiveData = - parameters.filterAssetRisksHasAccessToSensitiveData; - String filterAssetEnvironments = parameters.filterAssetEnvironments; - String filterAssetArch = parameters.filterAssetArch; - String filterAssetOperatingSystemName = parameters.filterAssetOperatingSystemName; - String filterAssetOperatingSystemVersion = parameters.filterAssetOperatingSystemVersion; + String filterQuery = parameters.filterQuery; + OffsetDateTime filterFrom = parameters.filterFrom; + OffsetDateTime filterTo = parameters.filterTo; + SecurityMonitoringSignalsSort sort = parameters.sort; + String pageCursor = parameters.pageCursor; + Integer pageLimit = parameters.pageLimit; // create path and map variables - String localVarPath = "/api/v2/security/vulnerabilities"; + String localVarPath = "/api/v2/security_monitoring/signals"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.base.score][`$op`]", filterCvssBaseScoreOp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.base.severity]", filterCvssBaseSeverity)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.base.vector]", filterCvssBaseVector)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[cvss.datadog.score][`$op`]", filterCvssDatadogScoreOp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.datadog.severity]", filterCvssDatadogSeverity)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.datadog.vector]", filterCvssDatadogVector)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tool]", filterTool)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[library.name]", filterLibraryName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[library.version]", filterLibraryVersion)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[advisory_id]", filterAdvisoryId)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.exploitation_probability]", filterRisksExploitationProbability)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.poc_exploit_available]", filterRisksPocExploitAvailable)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.exploit_available]", filterRisksExploitAvailable)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.epss.score][`$op`]", filterRisksEpssScoreOp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.epss.severity]", filterRisksEpssSeverity)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[language]", filterLanguage)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[ecosystem]", filterEcosystem)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[code_location.location]", filterCodeLocationLocation)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[code_location.file_path]", filterCodeLocationFilePath)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[code_location.method]", filterCodeLocationMethod)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[fix_available]", filterFixAvailable)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[repo_digests]", filterRepoDigests)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.type]", filterAssetType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.version.first]", filterAssetVersionFirst)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.version.last]", filterAssetVersionLast)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.repository_url]", filterAssetRepositoryUrl)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.risks.in_production]", filterAssetRisksInProduction)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.risks.under_attack]", filterAssetRisksUnderAttack)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", - "filter[asset.risks.is_publicly_accessible]", - filterAssetRisksIsPubliclyAccessible)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.risks.has_privileged_access]", filterAssetRisksHasPrivilegedAccess)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", - "filter[asset.risks.has_access_to_sensitive_data]", - filterAssetRisksHasAccessToSensitiveData)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.environments]", filterAssetEnvironments)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.arch]", filterAssetArch)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.operating_system.name]", filterAssetOperatingSystemName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.operating_system.version]", filterAssetOperatingSystemVersion)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listVulnerabilities", + "v2.SecurityMonitoringApi.listSecurityMonitoringSignals", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -5695,429 +5726,2096 @@ public ApiResponse listVulnerabilitiesWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List vulnerabilities. + * Get a quick list of security signals. * - *

See {@link #listVulnerabilitiesWithHttpInfo}. + *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ListVulnerabilitiesResponse>> + * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> */ - public CompletableFuture> - listVulnerabilitiesWithHttpInfoAsync(ListVulnerabilitiesOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "listVulnerabilities"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> + listSecurityMonitoringSignalsWithHttpInfoAsync( + ListSecurityMonitoringSignalsOptionalParameters parameters) { Object localVarPostBody = null; - String pageToken = parameters.pageToken; - Long pageNumber = parameters.pageNumber; - VulnerabilityType filterType = parameters.filterType; - Double filterCvssBaseScoreOp = parameters.filterCvssBaseScoreOp; - VulnerabilitySeverity filterCvssBaseSeverity = parameters.filterCvssBaseSeverity; - String filterCvssBaseVector = parameters.filterCvssBaseVector; - Double filterCvssDatadogScoreOp = parameters.filterCvssDatadogScoreOp; - VulnerabilitySeverity filterCvssDatadogSeverity = parameters.filterCvssDatadogSeverity; - String filterCvssDatadogVector = parameters.filterCvssDatadogVector; - VulnerabilityStatus filterStatus = parameters.filterStatus; - VulnerabilityTool filterTool = parameters.filterTool; - String filterLibraryName = parameters.filterLibraryName; - String filterLibraryVersion = parameters.filterLibraryVersion; - String filterAdvisoryId = parameters.filterAdvisoryId; - Boolean filterRisksExploitationProbability = parameters.filterRisksExploitationProbability; - Boolean filterRisksPocExploitAvailable = parameters.filterRisksPocExploitAvailable; - Boolean filterRisksExploitAvailable = parameters.filterRisksExploitAvailable; - Double filterRisksEpssScoreOp = parameters.filterRisksEpssScoreOp; - VulnerabilitySeverity filterRisksEpssSeverity = parameters.filterRisksEpssSeverity; - String filterLanguage = parameters.filterLanguage; - VulnerabilityEcosystem filterEcosystem = parameters.filterEcosystem; - String filterCodeLocationLocation = parameters.filterCodeLocationLocation; - String filterCodeLocationFilePath = parameters.filterCodeLocationFilePath; - String filterCodeLocationMethod = parameters.filterCodeLocationMethod; - Boolean filterFixAvailable = parameters.filterFixAvailable; - String filterRepoDigests = parameters.filterRepoDigests; - String filterAssetName = parameters.filterAssetName; - AssetType filterAssetType = parameters.filterAssetType; - String filterAssetVersionFirst = parameters.filterAssetVersionFirst; - String filterAssetVersionLast = parameters.filterAssetVersionLast; - String filterAssetRepositoryUrl = parameters.filterAssetRepositoryUrl; - Boolean filterAssetRisksInProduction = parameters.filterAssetRisksInProduction; - Boolean filterAssetRisksUnderAttack = parameters.filterAssetRisksUnderAttack; - Boolean filterAssetRisksIsPubliclyAccessible = parameters.filterAssetRisksIsPubliclyAccessible; - Boolean filterAssetRisksHasPrivilegedAccess = parameters.filterAssetRisksHasPrivilegedAccess; - Boolean filterAssetRisksHasAccessToSensitiveData = - parameters.filterAssetRisksHasAccessToSensitiveData; - String filterAssetEnvironments = parameters.filterAssetEnvironments; - String filterAssetArch = parameters.filterAssetArch; - String filterAssetOperatingSystemName = parameters.filterAssetOperatingSystemName; - String filterAssetOperatingSystemVersion = parameters.filterAssetOperatingSystemVersion; + String filterQuery = parameters.filterQuery; + OffsetDateTime filterFrom = parameters.filterFrom; + OffsetDateTime filterTo = parameters.filterTo; + SecurityMonitoringSignalsSort sort = parameters.sort; + String pageCursor = parameters.pageCursor; + Integer pageLimit = parameters.pageLimit; // create path and map variables - String localVarPath = "/api/v2/security/vulnerabilities"; + String localVarPath = "/api/v2/security_monitoring/signals"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.base.score][`$op`]", filterCvssBaseScoreOp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.base.severity]", filterCvssBaseSeverity)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.base.vector]", filterCvssBaseVector)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[cvss.datadog.score][`$op`]", filterCvssDatadogScoreOp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.datadog.severity]", filterCvssDatadogSeverity)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.datadog.vector]", filterCvssDatadogVector)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tool]", filterTool)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[library.name]", filterLibraryName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[library.version]", filterLibraryVersion)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[advisory_id]", filterAdvisoryId)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.exploitation_probability]", filterRisksExploitationProbability)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringSignals", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all suppression rules. + * + *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfo}. + * + * @return SecurityMonitoringSuppressionsResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringSuppressionsResponse listSecurityMonitoringSuppressions() + throws ApiException { + return listSecurityMonitoringSuppressionsWithHttpInfo().getData(); + } + + /** + * Get all suppression rules. + * + *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfoAsync}. + * + * @return CompletableFuture<SecurityMonitoringSuppressionsResponse> + */ + public CompletableFuture + listSecurityMonitoringSuppressionsAsync() { + return listSecurityMonitoringSuppressionsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of all suppression rules. + * + * @return ApiResponse<SecurityMonitoringSuppressionsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + listSecurityMonitoringSuppressionsWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringSuppressions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all suppression rules. + * + *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionsResponse>> + */ + public CompletableFuture> + listSecurityMonitoringSuppressionsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringSuppressions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listVulnerabilities. */ + public static class ListVulnerabilitiesOptionalParameters { + private String pageToken; + private Long pageNumber; + private VulnerabilityType filterType; + private Double filterCvssBaseScoreOp; + private VulnerabilitySeverity filterCvssBaseSeverity; + private String filterCvssBaseVector; + private Double filterCvssDatadogScoreOp; + private VulnerabilitySeverity filterCvssDatadogSeverity; + private String filterCvssDatadogVector; + private VulnerabilityStatus filterStatus; + private VulnerabilityTool filterTool; + private String filterLibraryName; + private String filterLibraryVersion; + private String filterAdvisoryId; + private Boolean filterRisksExploitationProbability; + private Boolean filterRisksPocExploitAvailable; + private Boolean filterRisksExploitAvailable; + private Double filterRisksEpssScoreOp; + private VulnerabilitySeverity filterRisksEpssSeverity; + private String filterLanguage; + private VulnerabilityEcosystem filterEcosystem; + private String filterCodeLocationLocation; + private String filterCodeLocationFilePath; + private String filterCodeLocationMethod; + private Boolean filterFixAvailable; + private String filterRepoDigests; + private String filterAssetName; + private AssetType filterAssetType; + private String filterAssetVersionFirst; + private String filterAssetVersionLast; + private String filterAssetRepositoryUrl; + private Boolean filterAssetRisksInProduction; + private Boolean filterAssetRisksUnderAttack; + private Boolean filterAssetRisksIsPubliclyAccessible; + private Boolean filterAssetRisksHasPrivilegedAccess; + private Boolean filterAssetRisksHasAccessToSensitiveData; + private String filterAssetEnvironments; + private String filterAssetArch; + private String filterAssetOperatingSystemName; + private String filterAssetOperatingSystemVersion; + + /** + * Set pageToken. + * + * @param pageToken Its value must come from the links section of the response of + * the first request. Do not manually edit it. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber The page number to be retrieved. It should be equal or greater than 1 + * (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set filterType. + * + * @param filterType Filter by vulnerability type. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterType(VulnerabilityType filterType) { + this.filterType = filterType; + return this; + } + + /** + * Set filterCvssBaseScoreOp. + * + * @param filterCvssBaseScoreOp Filter by vulnerability base (i.e. from the original advisory) + * severity score. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterCvssBaseScoreOp( + Double filterCvssBaseScoreOp) { + this.filterCvssBaseScoreOp = filterCvssBaseScoreOp; + return this; + } + + /** + * Set filterCvssBaseSeverity. + * + * @param filterCvssBaseSeverity Filter by vulnerability base severity. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterCvssBaseSeverity( + VulnerabilitySeverity filterCvssBaseSeverity) { + this.filterCvssBaseSeverity = filterCvssBaseSeverity; + return this; + } + + /** + * Set filterCvssBaseVector. + * + * @param filterCvssBaseVector Filter by vulnerability base CVSS vector. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterCvssBaseVector(String filterCvssBaseVector) { + this.filterCvssBaseVector = filterCvssBaseVector; + return this; + } + + /** + * Set filterCvssDatadogScoreOp. + * + * @param filterCvssDatadogScoreOp Filter by vulnerability Datadog severity score. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterCvssDatadogScoreOp( + Double filterCvssDatadogScoreOp) { + this.filterCvssDatadogScoreOp = filterCvssDatadogScoreOp; + return this; + } + + /** + * Set filterCvssDatadogSeverity. + * + * @param filterCvssDatadogSeverity Filter by vulnerability Datadog severity. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterCvssDatadogSeverity( + VulnerabilitySeverity filterCvssDatadogSeverity) { + this.filterCvssDatadogSeverity = filterCvssDatadogSeverity; + return this; + } + + /** + * Set filterCvssDatadogVector. + * + * @param filterCvssDatadogVector Filter by vulnerability Datadog CVSS vector. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterCvssDatadogVector( + String filterCvssDatadogVector) { + this.filterCvssDatadogVector = filterCvssDatadogVector; + return this; + } + + /** + * Set filterStatus. + * + * @param filterStatus Filter by the status of the vulnerability. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterStatus(VulnerabilityStatus filterStatus) { + this.filterStatus = filterStatus; + return this; + } + + /** + * Set filterTool. + * + * @param filterTool Filter by the tool of the vulnerability. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterTool(VulnerabilityTool filterTool) { + this.filterTool = filterTool; + return this; + } + + /** + * Set filterLibraryName. + * + * @param filterLibraryName Filter by library name. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterLibraryName(String filterLibraryName) { + this.filterLibraryName = filterLibraryName; + return this; + } + + /** + * Set filterLibraryVersion. + * + * @param filterLibraryVersion Filter by library version. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterLibraryVersion(String filterLibraryVersion) { + this.filterLibraryVersion = filterLibraryVersion; + return this; + } + + /** + * Set filterAdvisoryId. + * + * @param filterAdvisoryId Filter by advisory ID. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAdvisoryId(String filterAdvisoryId) { + this.filterAdvisoryId = filterAdvisoryId; + return this; + } + + /** + * Set filterRisksExploitationProbability. + * + * @param filterRisksExploitationProbability Filter by exploitation probability. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterRisksExploitationProbability( + Boolean filterRisksExploitationProbability) { + this.filterRisksExploitationProbability = filterRisksExploitationProbability; + return this; + } + + /** + * Set filterRisksPocExploitAvailable. + * + * @param filterRisksPocExploitAvailable Filter by POC exploit availability. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterRisksPocExploitAvailable( + Boolean filterRisksPocExploitAvailable) { + this.filterRisksPocExploitAvailable = filterRisksPocExploitAvailable; + return this; + } + + /** + * Set filterRisksExploitAvailable. + * + * @param filterRisksExploitAvailable Filter by public exploit availability. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterRisksExploitAvailable( + Boolean filterRisksExploitAvailable) { + this.filterRisksExploitAvailable = filterRisksExploitAvailable; + return this; + } + + /** + * Set filterRisksEpssScoreOp. + * + * @param filterRisksEpssScoreOp Filter by vulnerability EPSS severity score. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterRisksEpssScoreOp( + Double filterRisksEpssScoreOp) { + this.filterRisksEpssScoreOp = filterRisksEpssScoreOp; + return this; + } + + /** + * Set filterRisksEpssSeverity. + * + * @param filterRisksEpssSeverity Filter by vulnerability EPSS severity. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterRisksEpssSeverity( + VulnerabilitySeverity filterRisksEpssSeverity) { + this.filterRisksEpssSeverity = filterRisksEpssSeverity; + return this; + } + + /** + * Set filterLanguage. + * + * @param filterLanguage Filter by language. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterLanguage(String filterLanguage) { + this.filterLanguage = filterLanguage; + return this; + } + + /** + * Set filterEcosystem. + * + * @param filterEcosystem Filter by ecosystem. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterEcosystem( + VulnerabilityEcosystem filterEcosystem) { + this.filterEcosystem = filterEcosystem; + return this; + } + + /** + * Set filterCodeLocationLocation. + * + * @param filterCodeLocationLocation Filter by vulnerability location. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterCodeLocationLocation( + String filterCodeLocationLocation) { + this.filterCodeLocationLocation = filterCodeLocationLocation; + return this; + } + + /** + * Set filterCodeLocationFilePath. + * + * @param filterCodeLocationFilePath Filter by vulnerability file path. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterCodeLocationFilePath( + String filterCodeLocationFilePath) { + this.filterCodeLocationFilePath = filterCodeLocationFilePath; + return this; + } + + /** + * Set filterCodeLocationMethod. + * + * @param filterCodeLocationMethod Filter by method. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterCodeLocationMethod( + String filterCodeLocationMethod) { + this.filterCodeLocationMethod = filterCodeLocationMethod; + return this; + } + + /** + * Set filterFixAvailable. + * + * @param filterFixAvailable Filter by fix availability. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterFixAvailable(Boolean filterFixAvailable) { + this.filterFixAvailable = filterFixAvailable; + return this; + } + + /** + * Set filterRepoDigests. + * + * @param filterRepoDigests Filter by vulnerability repo_digest (when the + * vulnerability is related to Image asset). (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterRepoDigests(String filterRepoDigests) { + this.filterRepoDigests = filterRepoDigests; + return this; + } + + /** + * Set filterAssetName. + * + * @param filterAssetName Filter by asset name. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetName(String filterAssetName) { + this.filterAssetName = filterAssetName; + return this; + } + + /** + * Set filterAssetType. + * + * @param filterAssetType Filter by asset type. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetType(AssetType filterAssetType) { + this.filterAssetType = filterAssetType; + return this; + } + + /** + * Set filterAssetVersionFirst. + * + * @param filterAssetVersionFirst Filter by the first version of the asset this vulnerability + * has been detected on. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetVersionFirst( + String filterAssetVersionFirst) { + this.filterAssetVersionFirst = filterAssetVersionFirst; + return this; + } + + /** + * Set filterAssetVersionLast. + * + * @param filterAssetVersionLast Filter by the last version of the asset this vulnerability has + * been detected on. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetVersionLast( + String filterAssetVersionLast) { + this.filterAssetVersionLast = filterAssetVersionLast; + return this; + } + + /** + * Set filterAssetRepositoryUrl. + * + * @param filterAssetRepositoryUrl Filter by the repository url associated to the asset. + * (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetRepositoryUrl( + String filterAssetRepositoryUrl) { + this.filterAssetRepositoryUrl = filterAssetRepositoryUrl; + return this; + } + + /** + * Set filterAssetRisksInProduction. + * + * @param filterAssetRisksInProduction Filter whether the asset is in production or not. + * (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetRisksInProduction( + Boolean filterAssetRisksInProduction) { + this.filterAssetRisksInProduction = filterAssetRisksInProduction; + return this; + } + + /** + * Set filterAssetRisksUnderAttack. + * + * @param filterAssetRisksUnderAttack Filter whether the asset is under attack or not. + * (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetRisksUnderAttack( + Boolean filterAssetRisksUnderAttack) { + this.filterAssetRisksUnderAttack = filterAssetRisksUnderAttack; + return this; + } + + /** + * Set filterAssetRisksIsPubliclyAccessible. + * + * @param filterAssetRisksIsPubliclyAccessible Filter whether the asset is publicly accessible + * or not. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetRisksIsPubliclyAccessible( + Boolean filterAssetRisksIsPubliclyAccessible) { + this.filterAssetRisksIsPubliclyAccessible = filterAssetRisksIsPubliclyAccessible; + return this; + } + + /** + * Set filterAssetRisksHasPrivilegedAccess. + * + * @param filterAssetRisksHasPrivilegedAccess Filter whether the asset is publicly accessible or + * not. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetRisksHasPrivilegedAccess( + Boolean filterAssetRisksHasPrivilegedAccess) { + this.filterAssetRisksHasPrivilegedAccess = filterAssetRisksHasPrivilegedAccess; + return this; + } + + /** + * Set filterAssetRisksHasAccessToSensitiveData. + * + * @param filterAssetRisksHasAccessToSensitiveData Filter whether the asset has access to + * sensitive data or not. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetRisksHasAccessToSensitiveData( + Boolean filterAssetRisksHasAccessToSensitiveData) { + this.filterAssetRisksHasAccessToSensitiveData = filterAssetRisksHasAccessToSensitiveData; + return this; + } + + /** + * Set filterAssetEnvironments. + * + * @param filterAssetEnvironments Filter by asset environments. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetEnvironments( + String filterAssetEnvironments) { + this.filterAssetEnvironments = filterAssetEnvironments; + return this; + } + + /** + * Set filterAssetArch. + * + * @param filterAssetArch Filter by asset architecture. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetArch(String filterAssetArch) { + this.filterAssetArch = filterAssetArch; + return this; + } + + /** + * Set filterAssetOperatingSystemName. + * + * @param filterAssetOperatingSystemName Filter by asset operating system name. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetOperatingSystemName( + String filterAssetOperatingSystemName) { + this.filterAssetOperatingSystemName = filterAssetOperatingSystemName; + return this; + } + + /** + * Set filterAssetOperatingSystemVersion. + * + * @param filterAssetOperatingSystemVersion Filter by asset operating system version. (optional) + * @return ListVulnerabilitiesOptionalParameters + */ + public ListVulnerabilitiesOptionalParameters filterAssetOperatingSystemVersion( + String filterAssetOperatingSystemVersion) { + this.filterAssetOperatingSystemVersion = filterAssetOperatingSystemVersion; + return this; + } + } + + /** + * List vulnerabilities. + * + *

See {@link #listVulnerabilitiesWithHttpInfo}. + * + * @return ListVulnerabilitiesResponse + * @throws ApiException if fails to make API call + */ + public ListVulnerabilitiesResponse listVulnerabilities() throws ApiException { + return listVulnerabilitiesWithHttpInfo(new ListVulnerabilitiesOptionalParameters()).getData(); + } + + /** + * List vulnerabilities. + * + *

See {@link #listVulnerabilitiesWithHttpInfoAsync}. + * + * @return CompletableFuture<ListVulnerabilitiesResponse> + */ + public CompletableFuture listVulnerabilitiesAsync() { + return listVulnerabilitiesWithHttpInfoAsync(new ListVulnerabilitiesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List vulnerabilities. + * + *

See {@link #listVulnerabilitiesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ListVulnerabilitiesResponse + * @throws ApiException if fails to make API call + */ + public ListVulnerabilitiesResponse listVulnerabilities( + ListVulnerabilitiesOptionalParameters parameters) throws ApiException { + return listVulnerabilitiesWithHttpInfo(parameters).getData(); + } + + /** + * List vulnerabilities. + * + *

See {@link #listVulnerabilitiesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListVulnerabilitiesResponse> + */ + public CompletableFuture listVulnerabilitiesAsync( + ListVulnerabilitiesOptionalParameters parameters) { + return listVulnerabilitiesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of vulnerabilities. + * + *

Pagination

+ * + *

Pagination is enabled by default in both vulnerabilities and assets + * . The size of the page varies depending on the endpoint and cannot be modified. To + * automate the request of the next page, you can use the links section in the response. + * + *

This endpoint will return paginated responses. The pages are stored in the links section of + * the response: + * + *

JSON + * { + * "data": [...], + * "meta": {...}, + * "links": { + * "self": "https://.../api/v2/security/vulnerabilities", + * "first": "https://.../api/v2/security/vulnerabilities?page[number]=1&page[token]=abc", + * "last": "https://.../api/v2/security/vulnerabilities?page[number]=43&page[token]=abc", + * "next": "https://.../api/v2/security/vulnerabilities?page[number]=2&page[token]=abc" + * } + * } + * + *

    + *
  • links.previous is empty if the first page is requested. + *
  • links.next is empty if the last page is requested. + *
+ * + *

Token

+ * + *

Vulnerabilities can be created, updated or deleted at any point in time. + * + *

Upon the first request, a token is created to ensure consistency across subsequent paginated + * requests. + * + *

A token is valid only for 24 hours. + * + *

First request

+ * + *

We consider a request to be the first request when there is no page[token] + * parameter. + * + *

The response of this first request contains the newly created token in the links + * section. + * + *

This token can then be used in the subsequent paginated requests. + * + *

Subsequent requests

+ * + *

Any request containing valid page[token] and page[number] + * parameters will be considered a subsequent request. + * + *

If the token is invalid, a 404 response will be returned. + * + *

If the page number is invalid, a 400 response will be returned. + * + *

Filtering

+ * + *

The request can include some filter parameters to filter the data to be retrieved. The + * format of the filter parameters follows the JSON:API format: + * filter[$prop_name], where prop_name is the property name in the entity + * being filtered by. + * + *

All filters can include multiple values, where data will be filtered with an OR clause: + * filter[title]=Title1,Title2 will filter all vulnerabilities where title is equal + * to Title1 OR Title2. + * + *

String filters are case sensitive. + * + *

Boolean filters accept true or false as values. + * + *

Number filters must include an operator as a second filter input: + * filter[$prop_name][$operator]. For example, for the vulnerabilities endpoint: + * filter[cvss.base.score][lte]=8. + * + *

Available operators are: eq (==), lt (<), lte + * (<=), gt (>) and gte (>=). + * + *

Metadata

+ * + *

Following JSON:API format, object + * including non-standard meta-information. + * + *

This endpoint includes the meta member in the response. For more details on each of the + * properties included in this section, check the endpoints response tables. + * + *

JSON + * { + * "data": [...], + * "meta": { + * "total": 1500, + * "count": 18732, + * "token": "some_token" + * }, + * "links": {...} + * } + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListVulnerabilitiesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: There is no request associated with the provided token. -
429 Too many requests -
+ */ + public ApiResponse listVulnerabilitiesWithHttpInfo( + ListVulnerabilitiesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listVulnerabilities"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + String pageToken = parameters.pageToken; + Long pageNumber = parameters.pageNumber; + VulnerabilityType filterType = parameters.filterType; + Double filterCvssBaseScoreOp = parameters.filterCvssBaseScoreOp; + VulnerabilitySeverity filterCvssBaseSeverity = parameters.filterCvssBaseSeverity; + String filterCvssBaseVector = parameters.filterCvssBaseVector; + Double filterCvssDatadogScoreOp = parameters.filterCvssDatadogScoreOp; + VulnerabilitySeverity filterCvssDatadogSeverity = parameters.filterCvssDatadogSeverity; + String filterCvssDatadogVector = parameters.filterCvssDatadogVector; + VulnerabilityStatus filterStatus = parameters.filterStatus; + VulnerabilityTool filterTool = parameters.filterTool; + String filterLibraryName = parameters.filterLibraryName; + String filterLibraryVersion = parameters.filterLibraryVersion; + String filterAdvisoryId = parameters.filterAdvisoryId; + Boolean filterRisksExploitationProbability = parameters.filterRisksExploitationProbability; + Boolean filterRisksPocExploitAvailable = parameters.filterRisksPocExploitAvailable; + Boolean filterRisksExploitAvailable = parameters.filterRisksExploitAvailable; + Double filterRisksEpssScoreOp = parameters.filterRisksEpssScoreOp; + VulnerabilitySeverity filterRisksEpssSeverity = parameters.filterRisksEpssSeverity; + String filterLanguage = parameters.filterLanguage; + VulnerabilityEcosystem filterEcosystem = parameters.filterEcosystem; + String filterCodeLocationLocation = parameters.filterCodeLocationLocation; + String filterCodeLocationFilePath = parameters.filterCodeLocationFilePath; + String filterCodeLocationMethod = parameters.filterCodeLocationMethod; + Boolean filterFixAvailable = parameters.filterFixAvailable; + String filterRepoDigests = parameters.filterRepoDigests; + String filterAssetName = parameters.filterAssetName; + AssetType filterAssetType = parameters.filterAssetType; + String filterAssetVersionFirst = parameters.filterAssetVersionFirst; + String filterAssetVersionLast = parameters.filterAssetVersionLast; + String filterAssetRepositoryUrl = parameters.filterAssetRepositoryUrl; + Boolean filterAssetRisksInProduction = parameters.filterAssetRisksInProduction; + Boolean filterAssetRisksUnderAttack = parameters.filterAssetRisksUnderAttack; + Boolean filterAssetRisksIsPubliclyAccessible = parameters.filterAssetRisksIsPubliclyAccessible; + Boolean filterAssetRisksHasPrivilegedAccess = parameters.filterAssetRisksHasPrivilegedAccess; + Boolean filterAssetRisksHasAccessToSensitiveData = + parameters.filterAssetRisksHasAccessToSensitiveData; + String filterAssetEnvironments = parameters.filterAssetEnvironments; + String filterAssetArch = parameters.filterAssetArch; + String filterAssetOperatingSystemName = parameters.filterAssetOperatingSystemName; + String filterAssetOperatingSystemVersion = parameters.filterAssetOperatingSystemVersion; + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.base.score][`$op`]", filterCvssBaseScoreOp)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.base.severity]", filterCvssBaseSeverity)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.base.vector]", filterCvssBaseVector)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[cvss.datadog.score][`$op`]", filterCvssDatadogScoreOp)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.datadog.severity]", filterCvssDatadogSeverity)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.datadog.vector]", filterCvssDatadogVector)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tool]", filterTool)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[library.name]", filterLibraryName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[library.version]", filterLibraryVersion)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[advisory_id]", filterAdvisoryId)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[risks.exploitation_probability]", filterRisksExploitationProbability)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[risks.poc_exploit_available]", filterRisksPocExploitAvailable)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[risks.exploit_available]", filterRisksExploitAvailable)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[risks.epss.score][`$op`]", filterRisksEpssScoreOp)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[risks.epss.severity]", filterRisksEpssSeverity)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[language]", filterLanguage)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[ecosystem]", filterEcosystem)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[code_location.location]", filterCodeLocationLocation)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[code_location.file_path]", filterCodeLocationFilePath)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[code_location.method]", filterCodeLocationMethod)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[fix_available]", filterFixAvailable)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[repo_digests]", filterRepoDigests)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.type]", filterAssetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.version.first]", filterAssetVersionFirst)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.version.last]", filterAssetVersionLast)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.repository_url]", filterAssetRepositoryUrl)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.risks.in_production]", filterAssetRisksInProduction)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.risks.under_attack]", filterAssetRisksUnderAttack)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", + "filter[asset.risks.is_publicly_accessible]", + filterAssetRisksIsPubliclyAccessible)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.risks.has_privileged_access]", filterAssetRisksHasPrivilegedAccess)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", + "filter[asset.risks.has_access_to_sensitive_data]", + filterAssetRisksHasAccessToSensitiveData)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.environments]", filterAssetEnvironments)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.arch]", filterAssetArch)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.operating_system.name]", filterAssetOperatingSystemName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.operating_system.version]", filterAssetOperatingSystemVersion)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listVulnerabilities", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List vulnerabilities. + * + *

See {@link #listVulnerabilitiesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListVulnerabilitiesResponse>> + */ + public CompletableFuture> + listVulnerabilitiesWithHttpInfoAsync(ListVulnerabilitiesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listVulnerabilities"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + String pageToken = parameters.pageToken; + Long pageNumber = parameters.pageNumber; + VulnerabilityType filterType = parameters.filterType; + Double filterCvssBaseScoreOp = parameters.filterCvssBaseScoreOp; + VulnerabilitySeverity filterCvssBaseSeverity = parameters.filterCvssBaseSeverity; + String filterCvssBaseVector = parameters.filterCvssBaseVector; + Double filterCvssDatadogScoreOp = parameters.filterCvssDatadogScoreOp; + VulnerabilitySeverity filterCvssDatadogSeverity = parameters.filterCvssDatadogSeverity; + String filterCvssDatadogVector = parameters.filterCvssDatadogVector; + VulnerabilityStatus filterStatus = parameters.filterStatus; + VulnerabilityTool filterTool = parameters.filterTool; + String filterLibraryName = parameters.filterLibraryName; + String filterLibraryVersion = parameters.filterLibraryVersion; + String filterAdvisoryId = parameters.filterAdvisoryId; + Boolean filterRisksExploitationProbability = parameters.filterRisksExploitationProbability; + Boolean filterRisksPocExploitAvailable = parameters.filterRisksPocExploitAvailable; + Boolean filterRisksExploitAvailable = parameters.filterRisksExploitAvailable; + Double filterRisksEpssScoreOp = parameters.filterRisksEpssScoreOp; + VulnerabilitySeverity filterRisksEpssSeverity = parameters.filterRisksEpssSeverity; + String filterLanguage = parameters.filterLanguage; + VulnerabilityEcosystem filterEcosystem = parameters.filterEcosystem; + String filterCodeLocationLocation = parameters.filterCodeLocationLocation; + String filterCodeLocationFilePath = parameters.filterCodeLocationFilePath; + String filterCodeLocationMethod = parameters.filterCodeLocationMethod; + Boolean filterFixAvailable = parameters.filterFixAvailable; + String filterRepoDigests = parameters.filterRepoDigests; + String filterAssetName = parameters.filterAssetName; + AssetType filterAssetType = parameters.filterAssetType; + String filterAssetVersionFirst = parameters.filterAssetVersionFirst; + String filterAssetVersionLast = parameters.filterAssetVersionLast; + String filterAssetRepositoryUrl = parameters.filterAssetRepositoryUrl; + Boolean filterAssetRisksInProduction = parameters.filterAssetRisksInProduction; + Boolean filterAssetRisksUnderAttack = parameters.filterAssetRisksUnderAttack; + Boolean filterAssetRisksIsPubliclyAccessible = parameters.filterAssetRisksIsPubliclyAccessible; + Boolean filterAssetRisksHasPrivilegedAccess = parameters.filterAssetRisksHasPrivilegedAccess; + Boolean filterAssetRisksHasAccessToSensitiveData = + parameters.filterAssetRisksHasAccessToSensitiveData; + String filterAssetEnvironments = parameters.filterAssetEnvironments; + String filterAssetArch = parameters.filterAssetArch; + String filterAssetOperatingSystemName = parameters.filterAssetOperatingSystemName; + String filterAssetOperatingSystemVersion = parameters.filterAssetOperatingSystemVersion; + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.base.score][`$op`]", filterCvssBaseScoreOp)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.base.severity]", filterCvssBaseSeverity)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.base.vector]", filterCvssBaseVector)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[cvss.datadog.score][`$op`]", filterCvssDatadogScoreOp)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.datadog.severity]", filterCvssDatadogSeverity)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[cvss.datadog.vector]", filterCvssDatadogVector)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tool]", filterTool)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[library.name]", filterLibraryName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[library.version]", filterLibraryVersion)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[advisory_id]", filterAdvisoryId)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[risks.exploitation_probability]", filterRisksExploitationProbability)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[risks.poc_exploit_available]", filterRisksPocExploitAvailable)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[risks.exploit_available]", filterRisksExploitAvailable)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[risks.epss.score][`$op`]", filterRisksEpssScoreOp)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[risks.epss.severity]", filterRisksEpssSeverity)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[language]", filterLanguage)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[ecosystem]", filterEcosystem)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[code_location.location]", filterCodeLocationLocation)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[code_location.file_path]", filterCodeLocationFilePath)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[code_location.method]", filterCodeLocationMethod)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[fix_available]", filterFixAvailable)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[repo_digests]", filterRepoDigests)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.type]", filterAssetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.version.first]", filterAssetVersionFirst)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.version.last]", filterAssetVersionLast)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.repository_url]", filterAssetRepositoryUrl)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.risks.in_production]", filterAssetRisksInProduction)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.risks.under_attack]", filterAssetRisksUnderAttack)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", + "filter[asset.risks.is_publicly_accessible]", + filterAssetRisksIsPubliclyAccessible)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.risks.has_privileged_access]", filterAssetRisksHasPrivilegedAccess)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", + "filter[asset.risks.has_access_to_sensitive_data]", + filterAssetRisksHasAccessToSensitiveData)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.environments]", filterAssetEnvironments)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.arch]", filterAssetArch)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.operating_system.name]", filterAssetOperatingSystemName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "filter[asset.operating_system.version]", filterAssetOperatingSystemVersion)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listVulnerabilities", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listVulnerableAssets. */ + public static class ListVulnerableAssetsOptionalParameters { + private String pageToken; + private Long pageNumber; + private String filterName; + private AssetType filterType; + private String filterVersionFirst; + private String filterVersionLast; + private String filterRepositoryUrl; + private Boolean filterRisksInProduction; + private Boolean filterRisksUnderAttack; + private Boolean filterRisksIsPubliclyAccessible; + private Boolean filterRisksHasPrivilegedAccess; + private Boolean filterRisksHasAccessToSensitiveData; + private String filterEnvironments; + private String filterArch; + private String filterOperatingSystemName; + private String filterOperatingSystemVersion; + + /** + * Set pageToken. + * + * @param pageToken Its value must come from the links section of the response of + * the first request. Do not manually edit it. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber The page number to be retrieved. It should be equal or greater than 1 + * (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set filterName. + * + * @param filterName Filter by name. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterName(String filterName) { + this.filterName = filterName; + return this; + } + + /** + * Set filterType. + * + * @param filterType Filter by type. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterType(AssetType filterType) { + this.filterType = filterType; + return this; + } + + /** + * Set filterVersionFirst. + * + * @param filterVersionFirst Filter by the first version of the asset since it has been + * vulnerable. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterVersionFirst(String filterVersionFirst) { + this.filterVersionFirst = filterVersionFirst; + return this; + } + + /** + * Set filterVersionLast. + * + * @param filterVersionLast Filter by the last detected version of the asset. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterVersionLast(String filterVersionLast) { + this.filterVersionLast = filterVersionLast; + return this; + } + + /** + * Set filterRepositoryUrl. + * + * @param filterRepositoryUrl Filter by the repository url associated to the asset. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterRepositoryUrl(String filterRepositoryUrl) { + this.filterRepositoryUrl = filterRepositoryUrl; + return this; + } + + /** + * Set filterRisksInProduction. + * + * @param filterRisksInProduction Filter whether the asset is in production or not. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterRisksInProduction( + Boolean filterRisksInProduction) { + this.filterRisksInProduction = filterRisksInProduction; + return this; + } + + /** + * Set filterRisksUnderAttack. + * + * @param filterRisksUnderAttack Filter whether the asset (Service) is under attack or not. + * (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterRisksUnderAttack( + Boolean filterRisksUnderAttack) { + this.filterRisksUnderAttack = filterRisksUnderAttack; + return this; + } + + /** + * Set filterRisksIsPubliclyAccessible. + * + * @param filterRisksIsPubliclyAccessible Filter whether the asset (Host) is publicly accessible + * or not. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterRisksIsPubliclyAccessible( + Boolean filterRisksIsPubliclyAccessible) { + this.filterRisksIsPubliclyAccessible = filterRisksIsPubliclyAccessible; + return this; + } + + /** + * Set filterRisksHasPrivilegedAccess. + * + * @param filterRisksHasPrivilegedAccess Filter whether the asset (Host) has privileged access + * or not. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterRisksHasPrivilegedAccess( + Boolean filterRisksHasPrivilegedAccess) { + this.filterRisksHasPrivilegedAccess = filterRisksHasPrivilegedAccess; + return this; + } + + /** + * Set filterRisksHasAccessToSensitiveData. + * + * @param filterRisksHasAccessToSensitiveData Filter whether the asset (Host) has access to + * sensitive data or not. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterRisksHasAccessToSensitiveData( + Boolean filterRisksHasAccessToSensitiveData) { + this.filterRisksHasAccessToSensitiveData = filterRisksHasAccessToSensitiveData; + return this; + } + + /** + * Set filterEnvironments. + * + * @param filterEnvironments Filter by environment. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterEnvironments(String filterEnvironments) { + this.filterEnvironments = filterEnvironments; + return this; + } + + /** + * Set filterArch. + * + * @param filterArch Filter by architecture. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterArch(String filterArch) { + this.filterArch = filterArch; + return this; + } + + /** + * Set filterOperatingSystemName. + * + * @param filterOperatingSystemName Filter by operating system name. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterOperatingSystemName( + String filterOperatingSystemName) { + this.filterOperatingSystemName = filterOperatingSystemName; + return this; + } + + /** + * Set filterOperatingSystemVersion. + * + * @param filterOperatingSystemVersion Filter by operating system version. (optional) + * @return ListVulnerableAssetsOptionalParameters + */ + public ListVulnerableAssetsOptionalParameters filterOperatingSystemVersion( + String filterOperatingSystemVersion) { + this.filterOperatingSystemVersion = filterOperatingSystemVersion; + return this; + } + } + + /** + * List vulnerable assets. + * + *

See {@link #listVulnerableAssetsWithHttpInfo}. + * + * @return ListVulnerableAssetsResponse + * @throws ApiException if fails to make API call + */ + public ListVulnerableAssetsResponse listVulnerableAssets() throws ApiException { + return listVulnerableAssetsWithHttpInfo(new ListVulnerableAssetsOptionalParameters()).getData(); + } + + /** + * List vulnerable assets. + * + *

See {@link #listVulnerableAssetsWithHttpInfoAsync}. + * + * @return CompletableFuture<ListVulnerableAssetsResponse> + */ + public CompletableFuture listVulnerableAssetsAsync() { + return listVulnerableAssetsWithHttpInfoAsync(new ListVulnerableAssetsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List vulnerable assets. + * + *

See {@link #listVulnerableAssetsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ListVulnerableAssetsResponse + * @throws ApiException if fails to make API call + */ + public ListVulnerableAssetsResponse listVulnerableAssets( + ListVulnerableAssetsOptionalParameters parameters) throws ApiException { + return listVulnerableAssetsWithHttpInfo(parameters).getData(); + } + + /** + * List vulnerable assets. + * + *

See {@link #listVulnerableAssetsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListVulnerableAssetsResponse> + */ + public CompletableFuture listVulnerableAssetsAsync( + ListVulnerableAssetsOptionalParameters parameters) { + return listVulnerableAssetsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of vulnerable assets. + * + *

Pagination

+ * + *

Please review the Pagination section for the "List + * Vulnerabilities" endpoint. + * + *

Filtering

+ * + *

Please review the Filtering section for the "List Vulnerabilities" + * endpoint. + * + *

Metadata

+ * + *

Please review the Metadata section for the "List Vulnerabilities" + * endpoint. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListVulnerableAssetsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: There is no request associated with the provided token. -
429 Too many requests -
+ */ + public ApiResponse listVulnerableAssetsWithHttpInfo( + ListVulnerableAssetsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listVulnerableAssets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + String pageToken = parameters.pageToken; + Long pageNumber = parameters.pageNumber; + String filterName = parameters.filterName; + AssetType filterType = parameters.filterType; + String filterVersionFirst = parameters.filterVersionFirst; + String filterVersionLast = parameters.filterVersionLast; + String filterRepositoryUrl = parameters.filterRepositoryUrl; + Boolean filterRisksInProduction = parameters.filterRisksInProduction; + Boolean filterRisksUnderAttack = parameters.filterRisksUnderAttack; + Boolean filterRisksIsPubliclyAccessible = parameters.filterRisksIsPubliclyAccessible; + Boolean filterRisksHasPrivilegedAccess = parameters.filterRisksHasPrivilegedAccess; + Boolean filterRisksHasAccessToSensitiveData = parameters.filterRisksHasAccessToSensitiveData; + String filterEnvironments = parameters.filterEnvironments; + String filterArch = parameters.filterArch; + String filterOperatingSystemName = parameters.filterOperatingSystemName; + String filterOperatingSystemVersion = parameters.filterOperatingSystemVersion; + // create path and map variables + String localVarPath = "/api/v2/security/assets"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.poc_exploit_available]", filterRisksPocExploitAvailable)); + apiClient.parameterToPairs("", "filter[version.first]", filterVersionFirst)); localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.exploit_available]", filterRisksExploitAvailable)); + apiClient.parameterToPairs("", "filter[version.last]", filterVersionLast)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.epss.score][`$op`]", filterRisksEpssScoreOp)); + apiClient.parameterToPairs("", "filter[repository_url]", filterRepositoryUrl)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.epss.severity]", filterRisksEpssSeverity)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[language]", filterLanguage)); + apiClient.parameterToPairs("", "filter[risks.in_production]", filterRisksInProduction)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[ecosystem]", filterEcosystem)); + apiClient.parameterToPairs("", "filter[risks.under_attack]", filterRisksUnderAttack)); localVarQueryParams.addAll( apiClient.parameterToPairs( - "", "filter[code_location.location]", filterCodeLocationLocation)); + "", "filter[risks.is_publicly_accessible]", filterRisksIsPubliclyAccessible)); localVarQueryParams.addAll( apiClient.parameterToPairs( - "", "filter[code_location.file_path]", filterCodeLocationFilePath)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[code_location.method]", filterCodeLocationMethod)); + "", "filter[risks.has_privileged_access]", filterRisksHasPrivilegedAccess)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[fix_available]", filterFixAvailable)); + apiClient.parameterToPairs( + "", "filter[risks.has_access_to_sensitive_data]", filterRisksHasAccessToSensitiveData)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[repo_digests]", filterRepoDigests)); + apiClient.parameterToPairs("", "filter[environments]", filterEnvironments)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[arch]", filterArch)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); + apiClient.parameterToPairs("", "filter[operating_system.name]", filterOperatingSystemName)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.type]", filterAssetType)); + apiClient.parameterToPairs( + "", "filter[operating_system.version]", filterOperatingSystemVersion)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listVulnerableAssets", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List vulnerable assets. + * + *

See {@link #listVulnerableAssetsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListVulnerableAssetsResponse>> + */ + public CompletableFuture> + listVulnerableAssetsWithHttpInfoAsync(ListVulnerableAssetsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listVulnerableAssets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + String pageToken = parameters.pageToken; + Long pageNumber = parameters.pageNumber; + String filterName = parameters.filterName; + AssetType filterType = parameters.filterType; + String filterVersionFirst = parameters.filterVersionFirst; + String filterVersionLast = parameters.filterVersionLast; + String filterRepositoryUrl = parameters.filterRepositoryUrl; + Boolean filterRisksInProduction = parameters.filterRisksInProduction; + Boolean filterRisksUnderAttack = parameters.filterRisksUnderAttack; + Boolean filterRisksIsPubliclyAccessible = parameters.filterRisksIsPubliclyAccessible; + Boolean filterRisksHasPrivilegedAccess = parameters.filterRisksHasPrivilegedAccess; + Boolean filterRisksHasAccessToSensitiveData = parameters.filterRisksHasAccessToSensitiveData; + String filterEnvironments = parameters.filterEnvironments; + String filterArch = parameters.filterArch; + String filterOperatingSystemName = parameters.filterOperatingSystemName; + String filterOperatingSystemVersion = parameters.filterOperatingSystemVersion; + // create path and map variables + String localVarPath = "/api/v2/security/assets"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.version.first]", filterAssetVersionFirst)); + apiClient.parameterToPairs("", "filter[version.first]", filterVersionFirst)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.version.last]", filterAssetVersionLast)); + apiClient.parameterToPairs("", "filter[version.last]", filterVersionLast)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.repository_url]", filterAssetRepositoryUrl)); + apiClient.parameterToPairs("", "filter[repository_url]", filterRepositoryUrl)); localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.risks.in_production]", filterAssetRisksInProduction)); + apiClient.parameterToPairs("", "filter[risks.in_production]", filterRisksInProduction)); localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.risks.under_attack]", filterAssetRisksUnderAttack)); + apiClient.parameterToPairs("", "filter[risks.under_attack]", filterRisksUnderAttack)); localVarQueryParams.addAll( apiClient.parameterToPairs( - "", - "filter[asset.risks.is_publicly_accessible]", - filterAssetRisksIsPubliclyAccessible)); + "", "filter[risks.is_publicly_accessible]", filterRisksIsPubliclyAccessible)); localVarQueryParams.addAll( apiClient.parameterToPairs( - "", "filter[asset.risks.has_privileged_access]", filterAssetRisksHasPrivilegedAccess)); + "", "filter[risks.has_privileged_access]", filterRisksHasPrivilegedAccess)); localVarQueryParams.addAll( apiClient.parameterToPairs( - "", - "filter[asset.risks.has_access_to_sensitive_data]", - filterAssetRisksHasAccessToSensitiveData)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.environments]", filterAssetEnvironments)); + "", "filter[risks.has_access_to_sensitive_data]", filterRisksHasAccessToSensitiveData)); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.arch]", filterAssetArch)); + apiClient.parameterToPairs("", "filter[environments]", filterEnvironments)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[arch]", filterArch)); localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.operating_system.name]", filterAssetOperatingSystemName)); + apiClient.parameterToPairs("", "filter[operating_system.name]", filterOperatingSystemName)); localVarQueryParams.addAll( apiClient.parameterToPairs( - "", "filter[asset.operating_system.version]", filterAssetOperatingSystemVersion)); + "", "filter[operating_system.version]", filterOperatingSystemVersion)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listVulnerableAssets", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Mute or unmute a batch of findings. + * + *

See {@link #muteFindingsWithHttpInfo}. + * + * @param body + *

Attributes

+ * All findings are updated with the same attributes. The request body must include at least + * two attributes: muted and reason. The allowed reasons depend on + * whether the finding is being muted or unmuted: - To mute a finding: PENDING_FIX + * , FALSE_POSITIVE, ACCEPTED_RISK, OTHER. - To + * unmute a finding : NO_PENDING_FIX, HUMAN_ERROR, + * NO_LONGER_ACCEPTED_RISK, OTHER. + *

Meta

+ * The request body must include a list of the finding IDs to be updated. (required) + * @return BulkMuteFindingsResponse + * @throws ApiException if fails to make API call + */ + public BulkMuteFindingsResponse muteFindings(BulkMuteFindingsRequest body) throws ApiException { + return muteFindingsWithHttpInfo(body).getData(); + } + + /** + * Mute or unmute a batch of findings. + * + *

See {@link #muteFindingsWithHttpInfoAsync}. + * + * @param body + *

Attributes

+ * All findings are updated with the same attributes. The request body must include at least + * two attributes: muted and reason. The allowed reasons depend on + * whether the finding is being muted or unmuted: - To mute a finding: PENDING_FIX + * , FALSE_POSITIVE, ACCEPTED_RISK, OTHER. - To + * unmute a finding : NO_PENDING_FIX, HUMAN_ERROR, + * NO_LONGER_ACCEPTED_RISK, OTHER. + *

Meta

+ * The request body must include a list of the finding IDs to be updated. (required) + * @return CompletableFuture<BulkMuteFindingsResponse> + */ + public CompletableFuture muteFindingsAsync( + BulkMuteFindingsRequest body) { + return muteFindingsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Mute or unmute findings. + * + * @param body + *

Attributes

+ * All findings are updated with the same attributes. The request body must include at least + * two attributes: muted and reason. The allowed reasons depend on + * whether the finding is being muted or unmuted: - To mute a finding: PENDING_FIX + * , FALSE_POSITIVE, ACCEPTED_RISK, OTHER. - To + * unmute a finding : NO_PENDING_FIX, HUMAN_ERROR, + * NO_LONGER_ACCEPTED_RISK, OTHER. + *

Meta

+ * The request body must include a list of the finding IDs to be updated. (required) + * @return ApiResponse<BulkMuteFindingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not Found: The requested finding cannot be found. -
422 Invalid Request: The server understands the request syntax but cannot process it due to invalid data. -
429 Too many requests: The rate limit set by the API has been exceeded. -
+ */ + public ApiResponse muteFindingsWithHttpInfo( + BulkMuteFindingsRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "muteFindings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling muteFindings"); + } + // create path and map variables + String localVarPath = "/api/v2/posture_management/findings"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.muteFindings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Mute or unmute a batch of findings. + * + *

See {@link #muteFindingsWithHttpInfo}. + * + * @param body + *

Attributes

+ * All findings are updated with the same attributes. The request body must include at least + * two attributes: muted and reason. The allowed reasons depend on + * whether the finding is being muted or unmuted: - To mute a finding: PENDING_FIX + * , FALSE_POSITIVE, ACCEPTED_RISK, OTHER. - To + * unmute a finding : NO_PENDING_FIX, HUMAN_ERROR, + * NO_LONGER_ACCEPTED_RISK, OTHER. + *

Meta

+ * The request body must include a list of the finding IDs to be updated. (required) + * @return CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> + */ + public CompletableFuture> muteFindingsWithHttpInfoAsync( + BulkMuteFindingsRequest body) { + // Check if unstable operation is enabled + String operationId = "muteFindings"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling muteFindings")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/posture_management/findings"; + + Map localVarHeaderParams = new HashMap(); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listVulnerabilities", + "v2.SecurityMonitoringApi.muteFindings", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listVulnerableAssets. */ - public static class ListVulnerableAssetsOptionalParameters { - private String pageToken; - private Long pageNumber; - private String filterName; - private AssetType filterType; - private String filterVersionFirst; - private String filterVersionLast; - private String filterRepositoryUrl; - private Boolean filterRisksInProduction; - private Boolean filterRisksUnderAttack; - private Boolean filterRisksIsPubliclyAccessible; - private Boolean filterRisksHasPrivilegedAccess; - private Boolean filterRisksHasAccessToSensitiveData; - private String filterEnvironments; - private String filterArch; - private String filterOperatingSystemName; - private String filterOperatingSystemVersion; - - /** - * Set pageToken. - * - * @param pageToken Its value must come from the links section of the response of - * the first request. Do not manually edit it. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters pageToken(String pageToken) { - this.pageToken = pageToken; - return this; - } - - /** - * Set pageNumber. - * - * @param pageNumber The page number to be retrieved. It should be equal or greater than 1 - * (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; - return this; - } - - /** - * Set filterName. - * - * @param filterName Filter by name. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterName(String filterName) { - this.filterName = filterName; - return this; - } - - /** - * Set filterType. - * - * @param filterType Filter by type. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterType(AssetType filterType) { - this.filterType = filterType; - return this; - } - - /** - * Set filterVersionFirst. - * - * @param filterVersionFirst Filter by the first version of the asset since it has been - * vulnerable. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterVersionFirst(String filterVersionFirst) { - this.filterVersionFirst = filterVersionFirst; - return this; - } - - /** - * Set filterVersionLast. - * - * @param filterVersionLast Filter by the last detected version of the asset. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterVersionLast(String filterVersionLast) { - this.filterVersionLast = filterVersionLast; - return this; - } - - /** - * Set filterRepositoryUrl. - * - * @param filterRepositoryUrl Filter by the repository url associated to the asset. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRepositoryUrl(String filterRepositoryUrl) { - this.filterRepositoryUrl = filterRepositoryUrl; - return this; - } - - /** - * Set filterRisksInProduction. - * - * @param filterRisksInProduction Filter whether the asset is in production or not. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRisksInProduction( - Boolean filterRisksInProduction) { - this.filterRisksInProduction = filterRisksInProduction; - return this; - } - - /** - * Set filterRisksUnderAttack. - * - * @param filterRisksUnderAttack Filter whether the asset (Service) is under attack or not. - * (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRisksUnderAttack( - Boolean filterRisksUnderAttack) { - this.filterRisksUnderAttack = filterRisksUnderAttack; - return this; - } + /** + * Patch an inbox rule. + * + *

See {@link #patchInboxRuleWithHttpInfo}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return InboxRuleResponse + * @throws ApiException if fails to make API call + */ + public InboxRuleResponse patchInboxRule(UUID inboxRuleId, PatchInboxRulesParameters body) + throws ApiException { + return patchInboxRuleWithHttpInfo(inboxRuleId, body).getData(); + } - /** - * Set filterRisksIsPubliclyAccessible. - * - * @param filterRisksIsPubliclyAccessible Filter whether the asset (Host) is publicly accessible - * or not. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRisksIsPubliclyAccessible( - Boolean filterRisksIsPubliclyAccessible) { - this.filterRisksIsPubliclyAccessible = filterRisksIsPubliclyAccessible; - return this; - } + /** + * Patch an inbox rule. + * + *

See {@link #patchInboxRuleWithHttpInfoAsync}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return CompletableFuture<InboxRuleResponse> + */ + public CompletableFuture patchInboxRuleAsync( + UUID inboxRuleId, PatchInboxRulesParameters body) { + return patchInboxRuleWithHttpInfoAsync(inboxRuleId, body) + .thenApply( + response -> { + return response.getData(); + }); + } - /** - * Set filterRisksHasPrivilegedAccess. - * - * @param filterRisksHasPrivilegedAccess Filter whether the asset (Host) has privileged access - * or not. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRisksHasPrivilegedAccess( - Boolean filterRisksHasPrivilegedAccess) { - this.filterRisksHasPrivilegedAccess = filterRisksHasPrivilegedAccess; - return this; - } + /** + * Partially update the inbox rule. All fields are optional; if a field is not provided, it will + * not be updated. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return ApiResponse<InboxRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Inbox rule successfully patched -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 The server cannot process the request because it contains invalid data. -
429 Too many requests -
+ */ + public ApiResponse patchInboxRuleWithHttpInfo( + UUID inboxRuleId, PatchInboxRulesParameters body) throws ApiException { + Object localVarPostBody = body; - /** - * Set filterRisksHasAccessToSensitiveData. - * - * @param filterRisksHasAccessToSensitiveData Filter whether the asset (Host) has access to - * sensitive data or not. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRisksHasAccessToSensitiveData( - Boolean filterRisksHasAccessToSensitiveData) { - this.filterRisksHasAccessToSensitiveData = filterRisksHasAccessToSensitiveData; - return this; + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'inboxRuleId' when calling patchInboxRule"); } - /** - * Set filterEnvironments. - * - * @param filterEnvironments Filter by environment. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterEnvironments(String filterEnvironments) { - this.filterEnvironments = filterEnvironments; - return this; + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling patchInboxRule"); } + // create path and map variables + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}" + .replaceAll( + "\\{" + "inbox_rule_id" + "\\}", apiClient.escapeString(inboxRuleId.toString())); - /** - * Set filterArch. - * - * @param filterArch Filter by architecture. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterArch(String filterArch) { - this.filterArch = filterArch; - return this; + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.patchInboxRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Patch an inbox rule. + * + *

See {@link #patchInboxRuleWithHttpInfo}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<InboxRuleResponse>> + */ + public CompletableFuture> patchInboxRuleWithHttpInfoAsync( + UUID inboxRuleId, PatchInboxRulesParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'inboxRuleId' when calling patchInboxRule")); + return result; } - /** - * Set filterOperatingSystemName. - * - * @param filterOperatingSystemName Filter by operating system name. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterOperatingSystemName( - String filterOperatingSystemName) { - this.filterOperatingSystemName = filterOperatingSystemName; - return this; + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling patchInboxRule")); + return result; } + // create path and map variables + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}" + .replaceAll( + "\\{" + "inbox_rule_id" + "\\}", apiClient.escapeString(inboxRuleId.toString())); - /** - * Set filterOperatingSystemVersion. - * - * @param filterOperatingSystemVersion Filter by operating system version. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterOperatingSystemVersion( - String filterOperatingSystemVersion) { - this.filterOperatingSystemVersion = filterOperatingSystemVersion; - return this; + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.patchInboxRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * List vulnerable assets. + * Patch a mute rule. * - *

See {@link #listVulnerableAssetsWithHttpInfo}. + *

See {@link #patchMuteRuleWithHttpInfo}. * - * @return ListVulnerableAssetsResponse + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return MuteRuleResponse * @throws ApiException if fails to make API call */ - public ListVulnerableAssetsResponse listVulnerableAssets() throws ApiException { - return listVulnerableAssetsWithHttpInfo(new ListVulnerableAssetsOptionalParameters()).getData(); + public MuteRuleResponse patchMuteRule(UUID muteRuleId, PatchMuteRuleParameters body) + throws ApiException { + return patchMuteRuleWithHttpInfo(muteRuleId, body).getData(); } /** - * List vulnerable assets. + * Patch a mute rule. * - *

See {@link #listVulnerableAssetsWithHttpInfoAsync}. + *

See {@link #patchMuteRuleWithHttpInfoAsync}. * - * @return CompletableFuture<ListVulnerableAssetsResponse> + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return CompletableFuture<MuteRuleResponse> */ - public CompletableFuture listVulnerableAssetsAsync() { - return listVulnerableAssetsWithHttpInfoAsync(new ListVulnerableAssetsOptionalParameters()) + public CompletableFuture patchMuteRuleAsync( + UUID muteRuleId, PatchMuteRuleParameters body) { + return patchMuteRuleWithHttpInfoAsync(muteRuleId, body) .thenApply( response -> { return response.getData(); @@ -6125,298 +7823,294 @@ public CompletableFuture listVulnerableAssetsAsync } /** - * List vulnerable assets. - * - *

See {@link #listVulnerableAssetsWithHttpInfo}. + * Partially update the mute rule. All fields are optional; if a field is not provided, it will + * not be updated. * - * @param parameters Optional parameters for the request. - * @return ListVulnerableAssetsResponse + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return ApiResponse<MuteRuleResponse> * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Mute rule successfully patched -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 The server cannot process the request because it contains invalid data. -
429 Too many requests -
*/ - public ListVulnerableAssetsResponse listVulnerableAssets( - ListVulnerableAssetsOptionalParameters parameters) throws ApiException { - return listVulnerableAssetsWithHttpInfo(parameters).getData(); + public ApiResponse patchMuteRuleWithHttpInfo( + UUID muteRuleId, PatchMuteRuleParameters body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'muteRuleId' when calling patchMuteRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling patchMuteRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.patchMuteRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * List vulnerable assets. + * Patch a mute rule. * - *

See {@link #listVulnerableAssetsWithHttpInfoAsync}. + *

See {@link #patchMuteRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListVulnerableAssetsResponse> + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> */ - public CompletableFuture listVulnerableAssetsAsync( - ListVulnerableAssetsOptionalParameters parameters) { - return listVulnerableAssetsWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); + public CompletableFuture> patchMuteRuleWithHttpInfoAsync( + UUID muteRuleId, PatchMuteRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'muteRuleId' when calling patchMuteRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling patchMuteRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.patchMuteRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * Get a list of vulnerable assets. - * - *

Pagination

- * - *

Please review the Pagination section for the "List - * Vulnerabilities" endpoint. + * Reorder the list of inbox rules in the pipeline. * - *

Filtering

+ *

See {@link #reorderInboxRulesWithHttpInfo}. * - *

Please review the Filtering section for the "List Vulnerabilities" - * endpoint. + * @param body The list of rules to reorder. The order of the rules in the list will be the new + * order in the pipeline. (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object reorderInboxRules(ReorderInboxRulesParameters body) throws ApiException { + return reorderInboxRulesWithHttpInfo(body).getData(); + } + + /** + * Reorder the list of inbox rules in the pipeline. * - *

Metadata

+ *

See {@link #reorderInboxRulesWithHttpInfoAsync}. * - *

Please review the Metadata section for the "List Vulnerabilities" - * endpoint. + * @param body The list of rules to reorder. The order of the rules in the list will be the new + * order in the pipeline. (required) + * @return CompletableFuture<Object> + */ + public CompletableFuture reorderInboxRulesAsync(ReorderInboxRulesParameters body) { + return reorderInboxRulesWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Reorder the list of inbox rules in the pipeline and return the reordered list of rules. To + * reorder fields you need to provide the full list of pipeline rules in the new order. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<ListVulnerableAssetsResponse> + * @param body The list of rules to reorder. The order of the rules in the list will be the new + * order in the pipeline. (required) + * @return ApiResponse<Object> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * - * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: There is no request associated with the provided token. -
200 The list of inbox rules -
400 Bad Request -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse listVulnerableAssetsWithHttpInfo( - ListVulnerableAssetsOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listVulnerableAssets"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + public ApiResponse reorderInboxRulesWithHttpInfo(ReorderInboxRulesParameters body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling reorderInboxRules"); } - Object localVarPostBody = null; - String pageToken = parameters.pageToken; - Long pageNumber = parameters.pageNumber; - String filterName = parameters.filterName; - AssetType filterType = parameters.filterType; - String filterVersionFirst = parameters.filterVersionFirst; - String filterVersionLast = parameters.filterVersionLast; - String filterRepositoryUrl = parameters.filterRepositoryUrl; - Boolean filterRisksInProduction = parameters.filterRisksInProduction; - Boolean filterRisksUnderAttack = parameters.filterRisksUnderAttack; - Boolean filterRisksIsPubliclyAccessible = parameters.filterRisksIsPubliclyAccessible; - Boolean filterRisksHasPrivilegedAccess = parameters.filterRisksHasPrivilegedAccess; - Boolean filterRisksHasAccessToSensitiveData = parameters.filterRisksHasAccessToSensitiveData; - String filterEnvironments = parameters.filterEnvironments; - String filterArch = parameters.filterArch; - String filterOperatingSystemName = parameters.filterOperatingSystemName; - String filterOperatingSystemVersion = parameters.filterOperatingSystemVersion; // create path and map variables - String localVarPath = "/api/v2/security/assets"; + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[version.first]", filterVersionFirst)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[version.last]", filterVersionLast)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[repository_url]", filterRepositoryUrl)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.in_production]", filterRisksInProduction)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.under_attack]", filterRisksUnderAttack)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.is_publicly_accessible]", filterRisksIsPubliclyAccessible)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.has_privileged_access]", filterRisksHasPrivilegedAccess)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.has_access_to_sensitive_data]", filterRisksHasAccessToSensitiveData)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[environments]", filterEnvironments)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[arch]", filterArch)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[operating_system.name]", filterOperatingSystemName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[operating_system.version]", filterOperatingSystemVersion)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listVulnerableAssets", + "v2.SecurityMonitoringApi.reorderInboxRules", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List vulnerable assets. + * Reorder the list of inbox rules in the pipeline. * - *

See {@link #listVulnerableAssetsWithHttpInfo}. + *

See {@link #reorderInboxRulesWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ListVulnerableAssetsResponse>> + * @param body The list of rules to reorder. The order of the rules in the list will be the new + * order in the pipeline. (required) + * @return CompletableFuture<ApiResponse<Object>> */ - public CompletableFuture> - listVulnerableAssetsWithHttpInfoAsync(ListVulnerableAssetsOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "listVulnerableAssets"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); + public CompletableFuture> reorderInboxRulesWithHttpInfoAsync( + ReorderInboxRulesParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, "Missing the required parameter 'body' when calling reorderInboxRules")); return result; } - Object localVarPostBody = null; - String pageToken = parameters.pageToken; - Long pageNumber = parameters.pageNumber; - String filterName = parameters.filterName; - AssetType filterType = parameters.filterType; - String filterVersionFirst = parameters.filterVersionFirst; - String filterVersionLast = parameters.filterVersionLast; - String filterRepositoryUrl = parameters.filterRepositoryUrl; - Boolean filterRisksInProduction = parameters.filterRisksInProduction; - Boolean filterRisksUnderAttack = parameters.filterRisksUnderAttack; - Boolean filterRisksIsPubliclyAccessible = parameters.filterRisksIsPubliclyAccessible; - Boolean filterRisksHasPrivilegedAccess = parameters.filterRisksHasPrivilegedAccess; - Boolean filterRisksHasAccessToSensitiveData = parameters.filterRisksHasAccessToSensitiveData; - String filterEnvironments = parameters.filterEnvironments; - String filterArch = parameters.filterArch; - String filterOperatingSystemName = parameters.filterOperatingSystemName; - String filterOperatingSystemVersion = parameters.filterOperatingSystemVersion; // create path and map variables - String localVarPath = "/api/v2/security/assets"; + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[name]", filterName)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[version.first]", filterVersionFirst)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[version.last]", filterVersionLast)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[repository_url]", filterRepositoryUrl)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.in_production]", filterRisksInProduction)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.under_attack]", filterRisksUnderAttack)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.is_publicly_accessible]", filterRisksIsPubliclyAccessible)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.has_privileged_access]", filterRisksHasPrivilegedAccess)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.has_access_to_sensitive_data]", filterRisksHasAccessToSensitiveData)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[environments]", filterEnvironments)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[arch]", filterArch)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[operating_system.name]", filterOperatingSystemName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[operating_system.version]", filterOperatingSystemVersion)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listVulnerableAssets", + "v2.SecurityMonitoringApi.reorderInboxRules", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Mute or unmute a batch of findings. + * Reorder the list of mute rules in the pipeline. * - *

See {@link #muteFindingsWithHttpInfo}. + *

See {@link #reorderMuteRulesWithHttpInfo}. * - * @param body - *

Attributes

- * All findings are updated with the same attributes. The request body must include at least - * two attributes: muted and reason. The allowed reasons depend on - * whether the finding is being muted or unmuted: - To mute a finding: PENDING_FIX - * , FALSE_POSITIVE, ACCEPTED_RISK, OTHER. - To - * unmute a finding : NO_PENDING_FIX, HUMAN_ERROR, - * NO_LONGER_ACCEPTED_RISK, OTHER. - *

Meta

- * The request body must include a list of the finding IDs to be updated. (required) - * @return BulkMuteFindingsResponse + * @param body The list of rules to reorder. The order of the rules in the list will be the new + * order in the pipeline. (required) + * @return Object * @throws ApiException if fails to make API call */ - public BulkMuteFindingsResponse muteFindings(BulkMuteFindingsRequest body) throws ApiException { - return muteFindingsWithHttpInfo(body).getData(); + public Object reorderMuteRules(ReorderMuteRulesParameters body) throws ApiException { + return reorderMuteRulesWithHttpInfo(body).getData(); } /** - * Mute or unmute a batch of findings. + * Reorder the list of mute rules in the pipeline. * - *

See {@link #muteFindingsWithHttpInfoAsync}. + *

See {@link #reorderMuteRulesWithHttpInfoAsync}. * - * @param body - *

Attributes

- * All findings are updated with the same attributes. The request body must include at least - * two attributes: muted and reason. The allowed reasons depend on - * whether the finding is being muted or unmuted: - To mute a finding: PENDING_FIX - * , FALSE_POSITIVE, ACCEPTED_RISK, OTHER. - To - * unmute a finding : NO_PENDING_FIX, HUMAN_ERROR, - * NO_LONGER_ACCEPTED_RISK, OTHER. - *

Meta

- * The request body must include a list of the finding IDs to be updated. (required) - * @return CompletableFuture<BulkMuteFindingsResponse> + * @param body The list of rules to reorder. The order of the rules in the list will be the new + * order in the pipeline. (required) + * @return CompletableFuture<Object> */ - public CompletableFuture muteFindingsAsync( - BulkMuteFindingsRequest body) { - return muteFindingsWithHttpInfoAsync(body) + public CompletableFuture reorderMuteRulesAsync(ReorderMuteRulesParameters body) { + return reorderMuteRulesWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -6424,113 +8118,80 @@ public CompletableFuture muteFindingsAsync( } /** - * Mute or unmute findings. + * Reorder the list of mute rules in the pipeline and return the reordered list of rules. To + * reorder fields you need to provide the full list of pipeline rules in the new order. * - * @param body - *

Attributes

- * All findings are updated with the same attributes. The request body must include at least - * two attributes: muted and reason. The allowed reasons depend on - * whether the finding is being muted or unmuted: - To mute a finding: PENDING_FIX - * , FALSE_POSITIVE, ACCEPTED_RISK, OTHER. - To - * unmute a finding : NO_PENDING_FIX, HUMAN_ERROR, - * NO_LONGER_ACCEPTED_RISK, OTHER. - *

Meta

- * The request body must include a list of the finding IDs to be updated. (required) - * @return ApiResponse<BulkMuteFindingsResponse> + * @param body The list of rules to reorder. The order of the rules in the list will be the new + * order in the pipeline. (required) + * @return ApiResponse<Object> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * - * - * - * + * + * + * + * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not Found: The requested finding cannot be found. -
422 Invalid Request: The server understands the request syntax but cannot process it due to invalid data. -
429 Too many requests: The rate limit set by the API has been exceeded. -
200 The list of mute rules -
400 Bad Request -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse muteFindingsWithHttpInfo( - BulkMuteFindingsRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "muteFindings"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } + public ApiResponse reorderMuteRulesWithHttpInfo(ReorderMuteRulesParameters body) + throws ApiException { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling muteFindings"); + 400, "Missing the required parameter 'body' when calling reorderMuteRules"); } // create path and map variables - String localVarPath = "/api/v2/posture_management/findings"; + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules/reorder"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.muteFindings", + "v2.SecurityMonitoringApi.reorderMuteRules", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "PATCH", + "POST", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** - * Mute or unmute a batch of findings. - * - *

See {@link #muteFindingsWithHttpInfo}. - * - * @param body - *

Attributes

- * All findings are updated with the same attributes. The request body must include at least - * two attributes: muted and reason. The allowed reasons depend on - * whether the finding is being muted or unmuted: - To mute a finding: PENDING_FIX - * , FALSE_POSITIVE, ACCEPTED_RISK, OTHER. - To - * unmute a finding : NO_PENDING_FIX, HUMAN_ERROR, - * NO_LONGER_ACCEPTED_RISK, OTHER. - *

Meta

- * The request body must include a list of the finding IDs to be updated. (required) - * @return CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> + /** + * Reorder the list of mute rules in the pipeline. + * + *

See {@link #reorderMuteRulesWithHttpInfo}. + * + * @param body The list of rules to reorder. The order of the rules in the list will be the new + * order in the pipeline. (required) + * @return CompletableFuture<ApiResponse<Object>> */ - public CompletableFuture> muteFindingsWithHttpInfoAsync( - BulkMuteFindingsRequest body) { - // Check if unstable operation is enabled - String operationId = "muteFindings"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> reorderMuteRulesWithHttpInfoAsync( + ReorderMuteRulesParameters body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'body' when calling muteFindings")); + new ApiException( + 400, "Missing the required parameter 'body' when calling reorderMuteRules")); return result; } // create path and map variables - String localVarPath = "/api/v2/posture_management/findings"; + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules/reorder"; Map localVarHeaderParams = new HashMap(); @@ -6538,27 +8199,27 @@ public CompletableFuture> muteFindingsWith try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.muteFindings", + "v2.SecurityMonitoringApi.reorderMuteRules", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "POST", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** @@ -7254,6 +8915,328 @@ public ApiResponse testSecurityMonitoringRul new GenericType() {}); } + /** + * Update an inbox rule. + * + *

See {@link #updateInboxRuleWithHttpInfo}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return InboxRuleResponse + * @throws ApiException if fails to make API call + */ + public InboxRuleResponse updateInboxRule(UUID inboxRuleId, UpdateInboxRuleParameters body) + throws ApiException { + return updateInboxRuleWithHttpInfo(inboxRuleId, body).getData(); + } + + /** + * Update an inbox rule. + * + *

See {@link #updateInboxRuleWithHttpInfoAsync}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return CompletableFuture<InboxRuleResponse> + */ + public CompletableFuture updateInboxRuleAsync( + UUID inboxRuleId, UpdateInboxRuleParameters body) { + return updateInboxRuleWithHttpInfoAsync(inboxRuleId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the whole inbox rule. If an optional field is not provided, it will be set to its + * default value. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return ApiResponse<InboxRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Inbox rule successfully updated -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 The server cannot process the request because it contains invalid data. -
429 Too many requests -
+ */ + public ApiResponse updateInboxRuleWithHttpInfo( + UUID inboxRuleId, UpdateInboxRuleParameters body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'inboxRuleId' when calling updateInboxRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateInboxRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}" + .replaceAll( + "\\{" + "inbox_rule_id" + "\\}", apiClient.escapeString(inboxRuleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateInboxRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update an inbox rule. + * + *

See {@link #updateInboxRuleWithHttpInfo}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<InboxRuleResponse>> + */ + public CompletableFuture> updateInboxRuleWithHttpInfoAsync( + UUID inboxRuleId, UpdateInboxRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'inboxRuleId' when calling updateInboxRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateInboxRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}" + .replaceAll( + "\\{" + "inbox_rule_id" + "\\}", apiClient.escapeString(inboxRuleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateInboxRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a mute rule. + * + *

See {@link #updateMuteRuleWithHttpInfo}. + * + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return MuteRuleResponse + * @throws ApiException if fails to make API call + */ + public MuteRuleResponse updateMuteRule(UUID muteRuleId, UpdateMuteRuleParameters body) + throws ApiException { + return updateMuteRuleWithHttpInfo(muteRuleId, body).getData(); + } + + /** + * Update a mute rule. + * + *

See {@link #updateMuteRuleWithHttpInfoAsync}. + * + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return CompletableFuture<MuteRuleResponse> + */ + public CompletableFuture updateMuteRuleAsync( + UUID muteRuleId, UpdateMuteRuleParameters body) { + return updateMuteRuleWithHttpInfoAsync(muteRuleId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update the whole mute rule. If an optional field is not provided, it will be set to its default + * value. + * + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return ApiResponse<MuteRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Mute rule successfully updated -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 The server cannot process the request because it contains invalid data. -
429 Too many requests -
+ */ + public ApiResponse updateMuteRuleWithHttpInfo( + UUID muteRuleId, UpdateMuteRuleParameters body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'muteRuleId' when calling updateMuteRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateMuteRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateMuteRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a mute rule. + * + *

See {@link #updateMuteRuleWithHttpInfo}. + * + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> + */ + public CompletableFuture> updateMuteRuleWithHttpInfoAsync( + UUID muteRuleId, UpdateMuteRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'muteRuleId' when calling updateMuteRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateMuteRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateMuteRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update a security filter. * diff --git a/src/main/java/com/datadog/api/client/v2/model/ActionInbox.java b/src/main/java/com/datadog/api/client/v2/model/ActionInbox.java new file mode 100644 index 00000000000..8b957cb87bc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ActionInbox.java @@ -0,0 +1,135 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Action of the inbox rule */ +@JsonPropertyOrder({ActionInbox.JSON_PROPERTY_REASON_DESCRIPTION}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ActionInbox { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_REASON_DESCRIPTION = "reason_description"; + private String reasonDescription; + + public ActionInbox reasonDescription(String reasonDescription) { + this.reasonDescription = reasonDescription; + return this; + } + + /** + * Free text to add a reason description. + * + * @return reasonDescription + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASON_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReasonDescription() { + return reasonDescription; + } + + public void setReasonDescription(String reasonDescription) { + this.reasonDescription = reasonDescription; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ActionInbox + */ + @JsonAnySetter + public ActionInbox putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ActionInbox object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActionInbox actionInbox = (ActionInbox) o; + return Objects.equals(this.reasonDescription, actionInbox.reasonDescription) + && Objects.equals(this.additionalProperties, actionInbox.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(reasonDescription, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActionInbox {\n"); + sb.append(" reasonDescription: ").append(toIndentedString(reasonDescription)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ActionMute.java b/src/main/java/com/datadog/api/client/v2/model/ActionMute.java new file mode 100644 index 00000000000..9f9cd757ba3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ActionMute.java @@ -0,0 +1,204 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Action of the mute rule */ +@JsonPropertyOrder({ + ActionMute.JSON_PROPERTY_EXPIRE_AT, + ActionMute.JSON_PROPERTY_REASON, + ActionMute.JSON_PROPERTY_REASON_DESCRIPTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ActionMute { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EXPIRE_AT = "expire_at"; + private Long expireAt; + + public static final String JSON_PROPERTY_REASON = "reason"; + private MuteReason reason; + + public static final String JSON_PROPERTY_REASON_DESCRIPTION = "reason_description"; + private String reasonDescription; + + public ActionMute() {} + + @JsonCreator + public ActionMute( + @JsonProperty(required = true, value = JSON_PROPERTY_REASON) MuteReason reason) { + this.reason = reason; + this.unparsed |= !reason.isValid(); + } + + public ActionMute expireAt(Long expireAt) { + this.expireAt = expireAt; + return this; + } + + /** + * End date of the mute rule (null means mute forever) + * + * @return expireAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EXPIRE_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getExpireAt() { + return expireAt; + } + + public void setExpireAt(Long expireAt) { + this.expireAt = expireAt; + } + + public ActionMute reason(MuteReason reason) { + this.reason = reason; + this.unparsed |= !reason.isValid(); + return this; + } + + /** + * Reason for muting a vulnerability + * + * @return reason + */ + @JsonProperty(JSON_PROPERTY_REASON) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteReason getReason() { + return reason; + } + + public void setReason(MuteReason reason) { + if (!reason.isValid()) { + this.unparsed = true; + } + this.reason = reason; + } + + public ActionMute reasonDescription(String reasonDescription) { + this.reasonDescription = reasonDescription; + return this; + } + + /** + * Free text to add a reason description. + * + * @return reasonDescription + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASON_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReasonDescription() { + return reasonDescription; + } + + public void setReasonDescription(String reasonDescription) { + this.reasonDescription = reasonDescription; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ActionMute + */ + @JsonAnySetter + public ActionMute putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ActionMute object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActionMute actionMute = (ActionMute) o; + return Objects.equals(this.expireAt, actionMute.expireAt) + && Objects.equals(this.reason, actionMute.reason) + && Objects.equals(this.reasonDescription, actionMute.reasonDescription) + && Objects.equals(this.additionalProperties, actionMute.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(expireAt, reason, reasonDescription, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActionMute {\n"); + sb.append(" expireAt: ").append(toIndentedString(expireAt)).append("\n"); + sb.append(" reason: ").append(toIndentedString(reason)).append("\n"); + sb.append(" reasonDescription: ").append(toIndentedString(reasonDescription)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParameters.java b/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParameters.java new file mode 100644 index 00000000000..96698fd1d19 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParameters.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Body of the inbox rule create request */ +@JsonPropertyOrder({CreateInboxRuleParameters.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateInboxRuleParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateInboxRuleParametersData data; + + public CreateInboxRuleParameters data(CreateInboxRuleParametersData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the inbox rule create request: the rule type, and the rule attributes. All fields are + * required. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateInboxRuleParametersData getData() { + return data; + } + + public void setData(CreateInboxRuleParametersData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateInboxRuleParameters + */ + @JsonAnySetter + public CreateInboxRuleParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateInboxRuleParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInboxRuleParameters createInboxRuleParameters = (CreateInboxRuleParameters) o; + return Objects.equals(this.data, createInboxRuleParameters.data) + && Objects.equals( + this.additionalProperties, createInboxRuleParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInboxRuleParameters {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParametersData.java b/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParametersData.java new file mode 100644 index 00000000000..e4ecc3967fd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParametersData.java @@ -0,0 +1,187 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Data of the inbox rule create request: the rule type, and the rule attributes. All fields are + * required. + */ +@JsonPropertyOrder({ + CreateInboxRuleParametersData.JSON_PROPERTY_ATTRIBUTES, + CreateInboxRuleParametersData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateInboxRuleParametersData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateInboxRuleParametersDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private InboxRulesType type; + + public CreateInboxRuleParametersData() {} + + @JsonCreator + public CreateInboxRuleParametersData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CreateInboxRuleParametersDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InboxRulesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateInboxRuleParametersData attributes( + CreateInboxRuleParametersDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the inbox rule create request: the rule name, the rule details, the associated + * action, and the optional enabled field. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateInboxRuleParametersDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateInboxRuleParametersDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateInboxRuleParametersData type(InboxRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to inbox rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InboxRulesType getType() { + return type; + } + + public void setType(InboxRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateInboxRuleParametersData + */ + @JsonAnySetter + public CreateInboxRuleParametersData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateInboxRuleParametersData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInboxRuleParametersData createInboxRuleParametersData = (CreateInboxRuleParametersData) o; + return Objects.equals(this.attributes, createInboxRuleParametersData.attributes) + && Objects.equals(this.type, createInboxRuleParametersData.type) + && Objects.equals( + this.additionalProperties, createInboxRuleParametersData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInboxRuleParametersData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParametersDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParametersDataAttributes.java new file mode 100644 index 00000000000..ef9c71b5505 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParametersDataAttributes.java @@ -0,0 +1,240 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes of the inbox rule create request: the rule name, the rule details, the associated + * action, and the optional enabled field. + */ +@JsonPropertyOrder({ + CreateInboxRuleParametersDataAttributes.JSON_PROPERTY_ACTION, + CreateInboxRuleParametersDataAttributes.JSON_PROPERTY_ENABLED, + CreateInboxRuleParametersDataAttributes.JSON_PROPERTY_NAME, + CreateInboxRuleParametersDataAttributes.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateInboxRuleParametersDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private ActionInbox action; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private Rule rule; + + public CreateInboxRuleParametersDataAttributes() {} + + @JsonCreator + public CreateInboxRuleParametersDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) ActionInbox action, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) Rule rule) { + this.action = action; + this.unparsed |= action.unparsed; + this.name = name; + this.rule = rule; + this.unparsed |= rule.unparsed; + } + + public CreateInboxRuleParametersDataAttributes action(ActionInbox action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * Action of the inbox rule + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ActionInbox getAction() { + return action; + } + + public void setAction(ActionInbox action) { + this.action = action; + } + + public CreateInboxRuleParametersDataAttributes enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Field used to enable or disable the rule. + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateInboxRuleParametersDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the pipeline rule + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateInboxRuleParametersDataAttributes rule(Rule rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * The definition of an automation pipeline rule scope. A rule can act on specific issue types, + * security rule types, security rule IDs, rule severities, or a query. The query can be used to + * filter resources on tags and attributes. The issue type and rule types fields are required. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Rule getRule() { + return rule; + } + + public void setRule(Rule rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateInboxRuleParametersDataAttributes + */ + @JsonAnySetter + public CreateInboxRuleParametersDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateInboxRuleParametersDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateInboxRuleParametersDataAttributes createInboxRuleParametersDataAttributes = + (CreateInboxRuleParametersDataAttributes) o; + return Objects.equals(this.action, createInboxRuleParametersDataAttributes.action) + && Objects.equals(this.enabled, createInboxRuleParametersDataAttributes.enabled) + && Objects.equals(this.name, createInboxRuleParametersDataAttributes.name) + && Objects.equals(this.rule, createInboxRuleParametersDataAttributes.rule) + && Objects.equals( + this.additionalProperties, + createInboxRuleParametersDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, enabled, name, rule, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateInboxRuleParametersDataAttributes {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateMuteRuleParameters.java b/src/main/java/com/datadog/api/client/v2/model/CreateMuteRuleParameters.java new file mode 100644 index 00000000000..f0bf41b95b7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateMuteRuleParameters.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Body of the mute rule create request */ +@JsonPropertyOrder({CreateMuteRuleParameters.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateMuteRuleParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateMuteRuleParametersData data; + + public CreateMuteRuleParameters data(CreateMuteRuleParametersData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the mute rule create request: the rule type, and the rule attributes. All fields are + * required. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CreateMuteRuleParametersData getData() { + return data; + } + + public void setData(CreateMuteRuleParametersData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateMuteRuleParameters + */ + @JsonAnySetter + public CreateMuteRuleParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateMuteRuleParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMuteRuleParameters createMuteRuleParameters = (CreateMuteRuleParameters) o; + return Objects.equals(this.data, createMuteRuleParameters.data) + && Objects.equals(this.additionalProperties, createMuteRuleParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateMuteRuleParameters {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateMuteRuleParametersData.java b/src/main/java/com/datadog/api/client/v2/model/CreateMuteRuleParametersData.java new file mode 100644 index 00000000000..49728b421d3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateMuteRuleParametersData.java @@ -0,0 +1,187 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Data of the mute rule create request: the rule type, and the rule attributes. All fields are + * required. + */ +@JsonPropertyOrder({ + CreateMuteRuleParametersData.JSON_PROPERTY_ATTRIBUTES, + CreateMuteRuleParametersData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateMuteRuleParametersData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateMuteRuleParametersDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MuteRulesType type; + + public CreateMuteRuleParametersData() {} + + @JsonCreator + public CreateMuteRuleParametersData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CreateMuteRuleParametersDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MuteRulesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CreateMuteRuleParametersData attributes( + CreateMuteRuleParametersDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the mute rule create request: the rule name, the rule details, the associated + * action, and the optional enabled field. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateMuteRuleParametersDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateMuteRuleParametersDataAttributes attributes) { + this.attributes = attributes; + } + + public CreateMuteRuleParametersData type(MuteRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to mute rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRulesType getType() { + return type; + } + + public void setType(MuteRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateMuteRuleParametersData + */ + @JsonAnySetter + public CreateMuteRuleParametersData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateMuteRuleParametersData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMuteRuleParametersData createMuteRuleParametersData = (CreateMuteRuleParametersData) o; + return Objects.equals(this.attributes, createMuteRuleParametersData.attributes) + && Objects.equals(this.type, createMuteRuleParametersData.type) + && Objects.equals( + this.additionalProperties, createMuteRuleParametersData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateMuteRuleParametersData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateMuteRuleParametersDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateMuteRuleParametersDataAttributes.java new file mode 100644 index 00000000000..413c1d13c69 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateMuteRuleParametersDataAttributes.java @@ -0,0 +1,239 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes of the mute rule create request: the rule name, the rule details, the associated + * action, and the optional enabled field. + */ +@JsonPropertyOrder({ + CreateMuteRuleParametersDataAttributes.JSON_PROPERTY_ACTION, + CreateMuteRuleParametersDataAttributes.JSON_PROPERTY_ENABLED, + CreateMuteRuleParametersDataAttributes.JSON_PROPERTY_NAME, + CreateMuteRuleParametersDataAttributes.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateMuteRuleParametersDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private ActionMute action; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private Rule rule; + + public CreateMuteRuleParametersDataAttributes() {} + + @JsonCreator + public CreateMuteRuleParametersDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) ActionMute action, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) Rule rule) { + this.action = action; + this.unparsed |= action.unparsed; + this.name = name; + this.rule = rule; + this.unparsed |= rule.unparsed; + } + + public CreateMuteRuleParametersDataAttributes action(ActionMute action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * Action of the mute rule + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ActionMute getAction() { + return action; + } + + public void setAction(ActionMute action) { + this.action = action; + } + + public CreateMuteRuleParametersDataAttributes enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Field used to enable or disable the rule. + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public CreateMuteRuleParametersDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the pipeline rule + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public CreateMuteRuleParametersDataAttributes rule(Rule rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * The definition of an automation pipeline rule scope. A rule can act on specific issue types, + * security rule types, security rule IDs, rule severities, or a query. The query can be used to + * filter resources on tags and attributes. The issue type and rule types fields are required. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Rule getRule() { + return rule; + } + + public void setRule(Rule rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateMuteRuleParametersDataAttributes + */ + @JsonAnySetter + public CreateMuteRuleParametersDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateMuteRuleParametersDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateMuteRuleParametersDataAttributes createMuteRuleParametersDataAttributes = + (CreateMuteRuleParametersDataAttributes) o; + return Objects.equals(this.action, createMuteRuleParametersDataAttributes.action) + && Objects.equals(this.enabled, createMuteRuleParametersDataAttributes.enabled) + && Objects.equals(this.name, createMuteRuleParametersDataAttributes.name) + && Objects.equals(this.rule, createMuteRuleParametersDataAttributes.rule) + && Objects.equals( + this.additionalProperties, createMuteRuleParametersDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, enabled, name, rule, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateMuteRuleParametersDataAttributes {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/InboxRule.java b/src/main/java/com/datadog/api/client/v2/model/InboxRule.java new file mode 100644 index 00000000000..31654e17e01 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InboxRule.java @@ -0,0 +1,214 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** + * Inbox rules are used to prioritize and add relevant vulnerabilities to your Security Inbox. An + * inbox rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are + * required. + */ +@JsonPropertyOrder({ + InboxRule.JSON_PROPERTY_ATTRIBUTES, + InboxRule.JSON_PROPERTY_ID, + InboxRule.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class InboxRule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private InboxRuleAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private InboxRulesType type; + + public InboxRule() {} + + @JsonCreator + public InboxRule( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + InboxRuleAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InboxRulesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public InboxRule attributes(InboxRuleAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the inbox rule + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InboxRuleAttributes getAttributes() { + return attributes; + } + + public void setAttributes(InboxRuleAttributes attributes) { + this.attributes = attributes; + } + + public InboxRule id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of a pipeline rule + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public InboxRule type(InboxRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to inbox rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InboxRulesType getType() { + return type; + } + + public void setType(InboxRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return InboxRule + */ + @JsonAnySetter + public InboxRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this InboxRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InboxRule inboxRule = (InboxRule) o; + return Objects.equals(this.attributes, inboxRule.attributes) + && Objects.equals(this.id, inboxRule.id) + && Objects.equals(this.type, inboxRule.type) + && Objects.equals(this.additionalProperties, inboxRule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InboxRule {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/InboxRuleAttributes.java b/src/main/java/com/datadog/api/client/v2/model/InboxRuleAttributes.java new file mode 100644 index 00000000000..4a24b868418 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InboxRuleAttributes.java @@ -0,0 +1,360 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the inbox rule */ +@JsonPropertyOrder({ + InboxRuleAttributes.JSON_PROPERTY_ACTION, + InboxRuleAttributes.JSON_PROPERTY_CREATED_AT, + InboxRuleAttributes.JSON_PROPERTY_CREATED_BY, + InboxRuleAttributes.JSON_PROPERTY_ENABLED, + InboxRuleAttributes.JSON_PROPERTY_MODIFIED_AT, + InboxRuleAttributes.JSON_PROPERTY_MODIFIED_BY, + InboxRuleAttributes.JSON_PROPERTY_NAME, + InboxRuleAttributes.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class InboxRuleAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private ActionInbox action; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private RuleUser createdBy; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private Long modifiedAt; + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private RuleUser modifiedBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private Rule rule; + + public InboxRuleAttributes() {} + + @JsonCreator + public InboxRuleAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) ActionInbox action, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) Long createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) RuleUser createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_ENABLED) Boolean enabled, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) Long modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_BY) RuleUser modifiedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) Rule rule) { + this.action = action; + this.unparsed |= action.unparsed; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + this.enabled = enabled; + this.modifiedAt = modifiedAt; + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + this.name = name; + this.rule = rule; + this.unparsed |= rule.unparsed; + } + + public InboxRuleAttributes action(ActionInbox action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * Action of the inbox rule + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ActionInbox getAction() { + return action; + } + + public void setAction(ActionInbox action) { + this.action = action; + } + + public InboxRuleAttributes createdAt(Long createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date as Unix timestamp in milliseconds + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public InboxRuleAttributes createdBy(RuleUser createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * User creating or modifying a rule + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RuleUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(RuleUser createdBy) { + this.createdBy = createdBy; + } + + public InboxRuleAttributes enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Field used to enable or disable the rule. + * + * @return enabled + */ + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public InboxRuleAttributes modifiedAt(Long modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Date as Unix timestamp in milliseconds + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(Long modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public InboxRuleAttributes modifiedBy(RuleUser modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * User creating or modifying a rule + * + * @return modifiedBy + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RuleUser getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(RuleUser modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public InboxRuleAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the pipeline rule + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public InboxRuleAttributes rule(Rule rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * The definition of an automation pipeline rule scope. A rule can act on specific issue types, + * security rule types, security rule IDs, rule severities, or a query. The query can be used to + * filter resources on tags and attributes. The issue type and rule types fields are required. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Rule getRule() { + return rule; + } + + public void setRule(Rule rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return InboxRuleAttributes + */ + @JsonAnySetter + public InboxRuleAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this InboxRuleAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InboxRuleAttributes inboxRuleAttributes = (InboxRuleAttributes) o; + return Objects.equals(this.action, inboxRuleAttributes.action) + && Objects.equals(this.createdAt, inboxRuleAttributes.createdAt) + && Objects.equals(this.createdBy, inboxRuleAttributes.createdBy) + && Objects.equals(this.enabled, inboxRuleAttributes.enabled) + && Objects.equals(this.modifiedAt, inboxRuleAttributes.modifiedAt) + && Objects.equals(this.modifiedBy, inboxRuleAttributes.modifiedBy) + && Objects.equals(this.name, inboxRuleAttributes.name) + && Objects.equals(this.rule, inboxRuleAttributes.rule) + && Objects.equals(this.additionalProperties, inboxRuleAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + action, + createdAt, + createdBy, + enabled, + modifiedAt, + modifiedBy, + name, + rule, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InboxRuleAttributes {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/InboxRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/InboxRuleResponse.java new file mode 100644 index 00000000000..5be436cd07a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InboxRuleResponse.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response object which includes an inbox rule. */ +@JsonPropertyOrder({InboxRuleResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class InboxRuleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private InboxRule data; + + public InboxRuleResponse data(InboxRule data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Inbox rules are used to prioritize and add relevant vulnerabilities to your Security Inbox. An + * inbox rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are + * required. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public InboxRule getData() { + return data; + } + + public void setData(InboxRule data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return InboxRuleResponse + */ + @JsonAnySetter + public InboxRuleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this InboxRuleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InboxRuleResponse inboxRuleResponse = (InboxRuleResponse) o; + return Objects.equals(this.data, inboxRuleResponse.data) + && Objects.equals(this.additionalProperties, inboxRuleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InboxRuleResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/InboxRulesType.java b/src/main/java/com/datadog/api/client/v2/model/InboxRulesType.java new file mode 100644 index 00000000000..8a08e72d995 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InboxRulesType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The pipeline rule type associated to inbox rules */ +@JsonSerialize(using = InboxRulesType.InboxRulesTypeSerializer.class) +public class InboxRulesType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("inbox_rules")); + + public static final InboxRulesType INBOX_RULES = new InboxRulesType("inbox_rules"); + + InboxRulesType(String value) { + super(value, allowedValues); + } + + public static class InboxRulesTypeSerializer extends StdSerializer { + public InboxRulesTypeSerializer(Class t) { + super(t); + } + + public InboxRulesTypeSerializer() { + this(null); + } + + @Override + public void serialize(InboxRulesType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static InboxRulesType fromValue(String value) { + return new InboxRulesType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IssueType.java b/src/main/java/com/datadog/api/client/v2/model/IssueType.java new file mode 100644 index 00000000000..def21b3a437 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IssueType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of issues on which the rule applies */ +@JsonSerialize(using = IssueType.IssueTypeSerializer.class) +public class IssueType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("vulnerability")); + + public static final IssueType VULNERABILITY = new IssueType("vulnerability"); + + IssueType(String value) { + super(value, allowedValues); + } + + public static class IssueTypeSerializer extends StdSerializer { + public IssueTypeSerializer(Class t) { + super(t); + } + + public IssueTypeSerializer() { + this(null); + } + + @Override + public void serialize(IssueType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IssueType fromValue(String value) { + return new IssueType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteReason.java b/src/main/java/com/datadog/api/client/v2/model/MuteReason.java new file mode 100644 index 00000000000..981ae069f50 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteReason.java @@ -0,0 +1,70 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Reason for muting a vulnerability */ +@JsonSerialize(using = MuteReason.MuteReasonSerializer.class) +public class MuteReason extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "duplicate", + "external_solution", + "false_positive", + "internal_solution", + "no_fix_available", + "other", + "pending_fix", + "risk_accepted")); + + public static final MuteReason DUPLICATE = new MuteReason("duplicate"); + public static final MuteReason EXTERNAL_SOLUTION = new MuteReason("external_solution"); + public static final MuteReason FALSE_POSITIVE = new MuteReason("false_positive"); + public static final MuteReason INTERNAL_SOLUTION = new MuteReason("internal_solution"); + public static final MuteReason NO_FIX_AVAILABLE = new MuteReason("no_fix_available"); + public static final MuteReason OTHER = new MuteReason("other"); + public static final MuteReason PENDING_FIX = new MuteReason("pending_fix"); + public static final MuteReason RISK_ACCEPTED = new MuteReason("risk_accepted"); + + MuteReason(String value) { + super(value, allowedValues); + } + + public static class MuteReasonSerializer extends StdSerializer { + public MuteReasonSerializer(Class t) { + super(t); + } + + public MuteReasonSerializer() { + this(null); + } + + @Override + public void serialize(MuteReason value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static MuteReason fromValue(String value) { + return new MuteReason(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteRule.java b/src/main/java/com/datadog/api/client/v2/model/MuteRule.java new file mode 100644 index 00000000000..14f8563876a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRule.java @@ -0,0 +1,213 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** + * Mute rules are used to proactively filter out known false positives or accepted risks. A mute + * rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + */ +@JsonPropertyOrder({ + MuteRule.JSON_PROPERTY_ATTRIBUTES, + MuteRule.JSON_PROPERTY_ID, + MuteRule.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MuteRuleAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MuteRulesType type; + + public MuteRule() {} + + @JsonCreator + public MuteRule( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + MuteRuleAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MuteRulesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MuteRule attributes(MuteRuleAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the mute rule + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleAttributes getAttributes() { + return attributes; + } + + public void setAttributes(MuteRuleAttributes attributes) { + this.attributes = attributes; + } + + public MuteRule id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of a pipeline rule + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public MuteRule type(MuteRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to mute rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRulesType getType() { + return type; + } + + public void setType(MuteRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRule + */ + @JsonAnySetter + public MuteRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRule muteRule = (MuteRule) o; + return Objects.equals(this.attributes, muteRule.attributes) + && Objects.equals(this.id, muteRule.id) + && Objects.equals(this.type, muteRule.type) + && Objects.equals(this.additionalProperties, muteRule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRule {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteRuleAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleAttributes.java new file mode 100644 index 00000000000..4c8304dbbc0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleAttributes.java @@ -0,0 +1,360 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the mute rule */ +@JsonPropertyOrder({ + MuteRuleAttributes.JSON_PROPERTY_ACTION, + MuteRuleAttributes.JSON_PROPERTY_CREATED_AT, + MuteRuleAttributes.JSON_PROPERTY_CREATED_BY, + MuteRuleAttributes.JSON_PROPERTY_ENABLED, + MuteRuleAttributes.JSON_PROPERTY_MODIFIED_AT, + MuteRuleAttributes.JSON_PROPERTY_MODIFIED_BY, + MuteRuleAttributes.JSON_PROPERTY_NAME, + MuteRuleAttributes.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private ActionMute action; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private Long createdAt; + + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private RuleUser createdBy; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private Long modifiedAt; + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private RuleUser modifiedBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private Rule rule; + + public MuteRuleAttributes() {} + + @JsonCreator + public MuteRuleAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) ActionMute action, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) Long createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) RuleUser createdBy, + @JsonProperty(required = true, value = JSON_PROPERTY_ENABLED) Boolean enabled, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) Long modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_BY) RuleUser modifiedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) Rule rule) { + this.action = action; + this.unparsed |= action.unparsed; + this.createdAt = createdAt; + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + this.enabled = enabled; + this.modifiedAt = modifiedAt; + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + this.name = name; + this.rule = rule; + this.unparsed |= rule.unparsed; + } + + public MuteRuleAttributes action(ActionMute action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * Action of the mute rule + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ActionMute getAction() { + return action; + } + + public void setAction(ActionMute action) { + this.action = action; + } + + public MuteRuleAttributes createdAt(Long createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Date as Unix timestamp in milliseconds + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public MuteRuleAttributes createdBy(RuleUser createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * User creating or modifying a rule + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RuleUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(RuleUser createdBy) { + this.createdBy = createdBy; + } + + public MuteRuleAttributes enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Field used to enable or disable the rule. + * + * @return enabled + */ + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public MuteRuleAttributes modifiedAt(Long modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * Date as Unix timestamp in milliseconds + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(Long modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public MuteRuleAttributes modifiedBy(RuleUser modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * User creating or modifying a rule + * + * @return modifiedBy + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public RuleUser getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(RuleUser modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public MuteRuleAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the pipeline rule + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public MuteRuleAttributes rule(Rule rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * The definition of an automation pipeline rule scope. A rule can act on specific issue types, + * security rule types, security rule IDs, rule severities, or a query. The query can be used to + * filter resources on tags and attributes. The issue type and rule types fields are required. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Rule getRule() { + return rule; + } + + public void setRule(Rule rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleAttributes + */ + @JsonAnySetter + public MuteRuleAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleAttributes muteRuleAttributes = (MuteRuleAttributes) o; + return Objects.equals(this.action, muteRuleAttributes.action) + && Objects.equals(this.createdAt, muteRuleAttributes.createdAt) + && Objects.equals(this.createdBy, muteRuleAttributes.createdBy) + && Objects.equals(this.enabled, muteRuleAttributes.enabled) + && Objects.equals(this.modifiedAt, muteRuleAttributes.modifiedAt) + && Objects.equals(this.modifiedBy, muteRuleAttributes.modifiedBy) + && Objects.equals(this.name, muteRuleAttributes.name) + && Objects.equals(this.rule, muteRuleAttributes.rule) + && Objects.equals(this.additionalProperties, muteRuleAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + action, + createdAt, + createdBy, + enabled, + modifiedAt, + modifiedBy, + name, + rule, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleAttributes {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleResponse.java new file mode 100644 index 00000000000..bc079a93e2f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleResponse.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response object which includes a mute rule. */ +@JsonPropertyOrder({MuteRuleResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MuteRule data; + + public MuteRuleResponse data(MuteRule data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Mute rules are used to proactively filter out known false positives or accepted risks. A mute + * rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MuteRule getData() { + return data; + } + + public void setData(MuteRule data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleResponse + */ + @JsonAnySetter + public MuteRuleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleResponse muteRuleResponse = (MuteRuleResponse) o; + return Objects.equals(this.data, muteRuleResponse.data) + && Objects.equals(this.additionalProperties, muteRuleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteRulesType.java b/src/main/java/com/datadog/api/client/v2/model/MuteRulesType.java new file mode 100644 index 00000000000..7c677203efc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRulesType.java @@ -0,0 +1,53 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The pipeline rule type associated to mute rules */ +@JsonSerialize(using = MuteRulesType.MuteRulesTypeSerializer.class) +public class MuteRulesType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("mute_rules")); + + public static final MuteRulesType MUTE_RULES = new MuteRulesType("mute_rules"); + + MuteRulesType(String value) { + super(value, allowedValues); + } + + public static class MuteRulesTypeSerializer extends StdSerializer { + public MuteRulesTypeSerializer(Class t) { + super(t); + } + + public MuteRulesTypeSerializer() { + this(null); + } + + @Override + public void serialize(MuteRulesType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static MuteRulesType fromValue(String value) { + return new MuteRulesType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchInboxRulesParameters.java b/src/main/java/com/datadog/api/client/v2/model/PatchInboxRulesParameters.java new file mode 100644 index 00000000000..a4829290983 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchInboxRulesParameters.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Body of the inbox rule patch request */ +@JsonPropertyOrder({PatchInboxRulesParameters.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchInboxRulesParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PatchInboxRulesParametersData data; + + public PatchInboxRulesParameters data(PatchInboxRulesParametersData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the inbox rule patch request: the rule UUID, the rule type, and the rule attributes. + * All fields are required. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchInboxRulesParametersData getData() { + return data; + } + + public void setData(PatchInboxRulesParametersData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchInboxRulesParameters + */ + @JsonAnySetter + public PatchInboxRulesParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchInboxRulesParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchInboxRulesParameters patchInboxRulesParameters = (PatchInboxRulesParameters) o; + return Objects.equals(this.data, patchInboxRulesParameters.data) + && Objects.equals( + this.additionalProperties, patchInboxRulesParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchInboxRulesParameters {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchInboxRulesParametersData.java b/src/main/java/com/datadog/api/client/v2/model/PatchInboxRulesParametersData.java new file mode 100644 index 00000000000..f6d5e5597e2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchInboxRulesParametersData.java @@ -0,0 +1,216 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** + * Data of the inbox rule patch request: the rule UUID, the rule type, and the rule attributes. All + * fields are required. + */ +@JsonPropertyOrder({ + PatchInboxRulesParametersData.JSON_PROPERTY_ATTRIBUTES, + PatchInboxRulesParametersData.JSON_PROPERTY_ID, + PatchInboxRulesParametersData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchInboxRulesParametersData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PatchInboxRulesParametersDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private InboxRulesType type; + + public PatchInboxRulesParametersData() {} + + @JsonCreator + public PatchInboxRulesParametersData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + PatchInboxRulesParametersDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InboxRulesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PatchInboxRulesParametersData attributes( + PatchInboxRulesParametersDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the inbox rule patch request: the rule name, the rule details, the associated + * action, and the enabled field. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PatchInboxRulesParametersDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(PatchInboxRulesParametersDataAttributes attributes) { + this.attributes = attributes; + } + + public PatchInboxRulesParametersData id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of a pipeline rule + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public PatchInboxRulesParametersData type(InboxRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to inbox rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InboxRulesType getType() { + return type; + } + + public void setType(InboxRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchInboxRulesParametersData + */ + @JsonAnySetter + public PatchInboxRulesParametersData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchInboxRulesParametersData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchInboxRulesParametersData patchInboxRulesParametersData = (PatchInboxRulesParametersData) o; + return Objects.equals(this.attributes, patchInboxRulesParametersData.attributes) + && Objects.equals(this.id, patchInboxRulesParametersData.id) + && Objects.equals(this.type, patchInboxRulesParametersData.type) + && Objects.equals( + this.additionalProperties, patchInboxRulesParametersData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchInboxRulesParametersData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchInboxRulesParametersDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PatchInboxRulesParametersDataAttributes.java new file mode 100644 index 00000000000..ea2a7c37317 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchInboxRulesParametersDataAttributes.java @@ -0,0 +1,228 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes of the inbox rule patch request: the rule name, the rule details, the associated + * action, and the enabled field. + */ +@JsonPropertyOrder({ + PatchInboxRulesParametersDataAttributes.JSON_PROPERTY_ACTION, + PatchInboxRulesParametersDataAttributes.JSON_PROPERTY_ENABLED, + PatchInboxRulesParametersDataAttributes.JSON_PROPERTY_NAME, + PatchInboxRulesParametersDataAttributes.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchInboxRulesParametersDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private ActionInbox action; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private Rule rule; + + public PatchInboxRulesParametersDataAttributes action(ActionInbox action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * Action of the inbox rule + * + * @return action + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ActionInbox getAction() { + return action; + } + + public void setAction(ActionInbox action) { + this.action = action; + } + + public PatchInboxRulesParametersDataAttributes enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Field used to enable or disable the rule. + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public PatchInboxRulesParametersDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the pipeline rule + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public PatchInboxRulesParametersDataAttributes rule(Rule rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * The definition of an automation pipeline rule scope. A rule can act on specific issue types, + * security rule types, security rule IDs, rule severities, or a query. The query can be used to + * filter resources on tags and attributes. The issue type and rule types fields are required. + * + * @return rule + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Rule getRule() { + return rule; + } + + public void setRule(Rule rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchInboxRulesParametersDataAttributes + */ + @JsonAnySetter + public PatchInboxRulesParametersDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchInboxRulesParametersDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchInboxRulesParametersDataAttributes patchInboxRulesParametersDataAttributes = + (PatchInboxRulesParametersDataAttributes) o; + return Objects.equals(this.action, patchInboxRulesParametersDataAttributes.action) + && Objects.equals(this.enabled, patchInboxRulesParametersDataAttributes.enabled) + && Objects.equals(this.name, patchInboxRulesParametersDataAttributes.name) + && Objects.equals(this.rule, patchInboxRulesParametersDataAttributes.rule) + && Objects.equals( + this.additionalProperties, + patchInboxRulesParametersDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, enabled, name, rule, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchInboxRulesParametersDataAttributes {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchMuteRuleParameters.java b/src/main/java/com/datadog/api/client/v2/model/PatchMuteRuleParameters.java new file mode 100644 index 00000000000..ea9917b3f04 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchMuteRuleParameters.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Body of the mute rule patch request */ +@JsonPropertyOrder({PatchMuteRuleParameters.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchMuteRuleParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private PatchMuteRuleParametersData data; + + public PatchMuteRuleParameters data(PatchMuteRuleParametersData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the mute rule patch request: the rule UUID, the rule type, and the rule attributes. All + * fields are required. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public PatchMuteRuleParametersData getData() { + return data; + } + + public void setData(PatchMuteRuleParametersData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchMuteRuleParameters + */ + @JsonAnySetter + public PatchMuteRuleParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchMuteRuleParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchMuteRuleParameters patchMuteRuleParameters = (PatchMuteRuleParameters) o; + return Objects.equals(this.data, patchMuteRuleParameters.data) + && Objects.equals(this.additionalProperties, patchMuteRuleParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchMuteRuleParameters {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchMuteRuleParametersData.java b/src/main/java/com/datadog/api/client/v2/model/PatchMuteRuleParametersData.java new file mode 100644 index 00000000000..423ce758931 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchMuteRuleParametersData.java @@ -0,0 +1,215 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** + * Data of the mute rule patch request: the rule UUID, the rule type, and the rule attributes. All + * fields are required. + */ +@JsonPropertyOrder({ + PatchMuteRuleParametersData.JSON_PROPERTY_ATTRIBUTES, + PatchMuteRuleParametersData.JSON_PROPERTY_ID, + PatchMuteRuleParametersData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchMuteRuleParametersData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private PatchMuteRuleParametersDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MuteRulesType type; + + public PatchMuteRuleParametersData() {} + + @JsonCreator + public PatchMuteRuleParametersData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + PatchMuteRuleParametersDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MuteRulesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public PatchMuteRuleParametersData attributes(PatchMuteRuleParametersDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the mute rule patch request: the rule name, the rule details, the associated + * action, and the enabled field. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public PatchMuteRuleParametersDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(PatchMuteRuleParametersDataAttributes attributes) { + this.attributes = attributes; + } + + public PatchMuteRuleParametersData id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of a pipeline rule + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public PatchMuteRuleParametersData type(MuteRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to mute rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRulesType getType() { + return type; + } + + public void setType(MuteRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchMuteRuleParametersData + */ + @JsonAnySetter + public PatchMuteRuleParametersData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchMuteRuleParametersData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchMuteRuleParametersData patchMuteRuleParametersData = (PatchMuteRuleParametersData) o; + return Objects.equals(this.attributes, patchMuteRuleParametersData.attributes) + && Objects.equals(this.id, patchMuteRuleParametersData.id) + && Objects.equals(this.type, patchMuteRuleParametersData.type) + && Objects.equals( + this.additionalProperties, patchMuteRuleParametersData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchMuteRuleParametersData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/PatchMuteRuleParametersDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/PatchMuteRuleParametersDataAttributes.java new file mode 100644 index 00000000000..069c77e3ae3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/PatchMuteRuleParametersDataAttributes.java @@ -0,0 +1,227 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** + * Attributes of the mute rule patch request: the rule name, the rule details, the associated + * action, and the enabled field. + */ +@JsonPropertyOrder({ + PatchMuteRuleParametersDataAttributes.JSON_PROPERTY_ACTION, + PatchMuteRuleParametersDataAttributes.JSON_PROPERTY_ENABLED, + PatchMuteRuleParametersDataAttributes.JSON_PROPERTY_NAME, + PatchMuteRuleParametersDataAttributes.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class PatchMuteRuleParametersDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private ActionMute action; + + public static final String JSON_PROPERTY_ENABLED = "enabled"; + private Boolean enabled; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private Rule rule; + + public PatchMuteRuleParametersDataAttributes action(ActionMute action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * Action of the mute rule + * + * @return action + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ActionMute getAction() { + return action; + } + + public void setAction(ActionMute action) { + this.action = action; + } + + public PatchMuteRuleParametersDataAttributes enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Field used to enable or disable the rule. + * + * @return enabled + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENABLED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public PatchMuteRuleParametersDataAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the pipeline rule + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public PatchMuteRuleParametersDataAttributes rule(Rule rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * The definition of an automation pipeline rule scope. A rule can act on specific issue types, + * security rule types, security rule IDs, rule severities, or a query. The query can be used to + * filter resources on tags and attributes. The issue type and rule types fields are required. + * + * @return rule + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Rule getRule() { + return rule; + } + + public void setRule(Rule rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return PatchMuteRuleParametersDataAttributes + */ + @JsonAnySetter + public PatchMuteRuleParametersDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this PatchMuteRuleParametersDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PatchMuteRuleParametersDataAttributes patchMuteRuleParametersDataAttributes = + (PatchMuteRuleParametersDataAttributes) o; + return Objects.equals(this.action, patchMuteRuleParametersDataAttributes.action) + && Objects.equals(this.enabled, patchMuteRuleParametersDataAttributes.enabled) + && Objects.equals(this.name, patchMuteRuleParametersDataAttributes.name) + && Objects.equals(this.rule, patchMuteRuleParametersDataAttributes.rule) + && Objects.equals( + this.additionalProperties, patchMuteRuleParametersDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, enabled, name, rule, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PatchMuteRuleParametersDataAttributes {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" rule: ").append(toIndentedString(rule)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReorderInboxRulesParameters.java b/src/main/java/com/datadog/api/client/v2/model/ReorderInboxRulesParameters.java new file mode 100644 index 00000000000..f82505fcdd1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReorderInboxRulesParameters.java @@ -0,0 +1,153 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Body of the inbox rule reorder request: the full list of inbox rules needs to be provided in the + * new order. + */ +@JsonPropertyOrder({ReorderInboxRulesParameters.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReorderInboxRulesParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public ReorderInboxRulesParameters data(List data) { + this.data = data; + for (ReorderInboxRulesParametersData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ReorderInboxRulesParameters addDataItem(ReorderInboxRulesParametersData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The ReorderInboxRulesParameters data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReorderInboxRulesParameters + */ + @JsonAnySetter + public ReorderInboxRulesParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReorderInboxRulesParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReorderInboxRulesParameters reorderInboxRulesParameters = (ReorderInboxRulesParameters) o; + return Objects.equals(this.data, reorderInboxRulesParameters.data) + && Objects.equals( + this.additionalProperties, reorderInboxRulesParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReorderInboxRulesParameters {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReorderInboxRulesParametersData.java b/src/main/java/com/datadog/api/client/v2/model/ReorderInboxRulesParametersData.java new file mode 100644 index 00000000000..85f1ca383c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReorderInboxRulesParametersData.java @@ -0,0 +1,184 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** + * Data of the inbox rule reorder request: the rule UUID, the rule type, and the rule attributes. + * All fields are required. + */ +@JsonPropertyOrder({ + ReorderInboxRulesParametersData.JSON_PROPERTY_ID, + ReorderInboxRulesParametersData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReorderInboxRulesParametersData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private InboxRulesType type; + + public ReorderInboxRulesParametersData() {} + + @JsonCreator + public ReorderInboxRulesParametersData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InboxRulesType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ReorderInboxRulesParametersData id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of a pipeline rule + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ReorderInboxRulesParametersData type(InboxRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to inbox rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InboxRulesType getType() { + return type; + } + + public void setType(InboxRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReorderInboxRulesParametersData + */ + @JsonAnySetter + public ReorderInboxRulesParametersData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReorderInboxRulesParametersData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReorderInboxRulesParametersData reorderInboxRulesParametersData = + (ReorderInboxRulesParametersData) o; + return Objects.equals(this.id, reorderInboxRulesParametersData.id) + && Objects.equals(this.type, reorderInboxRulesParametersData.type) + && Objects.equals( + this.additionalProperties, reorderInboxRulesParametersData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReorderInboxRulesParametersData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReorderMuteRulesParameters.java b/src/main/java/com/datadog/api/client/v2/model/ReorderMuteRulesParameters.java new file mode 100644 index 00000000000..35072b5ea95 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReorderMuteRulesParameters.java @@ -0,0 +1,153 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Body of the mute rule reorder request: the full list of mute rules needs to be provided in the + * new order. + */ +@JsonPropertyOrder({ReorderMuteRulesParameters.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReorderMuteRulesParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public ReorderMuteRulesParameters data(List data) { + this.data = data; + for (ReorderMuteRulesParametersData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ReorderMuteRulesParameters addDataItem(ReorderMuteRulesParametersData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The ReorderMuteRulesParameters data. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReorderMuteRulesParameters + */ + @JsonAnySetter + public ReorderMuteRulesParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReorderMuteRulesParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReorderMuteRulesParameters reorderMuteRulesParameters = (ReorderMuteRulesParameters) o; + return Objects.equals(this.data, reorderMuteRulesParameters.data) + && Objects.equals( + this.additionalProperties, reorderMuteRulesParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReorderMuteRulesParameters {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ReorderMuteRulesParametersData.java b/src/main/java/com/datadog/api/client/v2/model/ReorderMuteRulesParametersData.java new file mode 100644 index 00000000000..27932c1160b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ReorderMuteRulesParametersData.java @@ -0,0 +1,181 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** Data of the mute rule reorder request: a rule UUID and its type. All fields are required. */ +@JsonPropertyOrder({ + ReorderMuteRulesParametersData.JSON_PROPERTY_ID, + ReorderMuteRulesParametersData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ReorderMuteRulesParametersData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MuteRulesType type; + + public ReorderMuteRulesParametersData() {} + + @JsonCreator + public ReorderMuteRulesParametersData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MuteRulesType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ReorderMuteRulesParametersData id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of a pipeline rule + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public ReorderMuteRulesParametersData type(MuteRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to mute rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRulesType getType() { + return type; + } + + public void setType(MuteRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ReorderMuteRulesParametersData + */ + @JsonAnySetter + public ReorderMuteRulesParametersData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ReorderMuteRulesParametersData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReorderMuteRulesParametersData reorderMuteRulesParametersData = + (ReorderMuteRulesParametersData) o; + return Objects.equals(this.id, reorderMuteRulesParametersData.id) + && Objects.equals(this.type, reorderMuteRulesParametersData.type) + && Objects.equals( + this.additionalProperties, reorderMuteRulesParametersData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReorderMuteRulesParametersData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/Rule.java b/src/main/java/com/datadog/api/client/v2/model/Rule.java new file mode 100644 index 00000000000..e1b6f6e8e35 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/Rule.java @@ -0,0 +1,290 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * The definition of an automation pipeline rule scope. A rule can act on specific issue types, + * security rule types, security rule IDs, rule severities, or a query. The query can be used to + * filter resources on tags and attributes. The issue type and rule types fields are required. + */ +@JsonPropertyOrder({ + Rule.JSON_PROPERTY_ISSUE_TYPE, + Rule.JSON_PROPERTY_QUERY, + Rule.JSON_PROPERTY_RULE_IDS, + Rule.JSON_PROPERTY_RULE_TYPES, + Rule.JSON_PROPERTY_SEVERITIES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class Rule { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ISSUE_TYPE = "issue_type"; + private IssueType issueType; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_RULE_IDS = "rule_ids"; + private List ruleIds = null; + + public static final String JSON_PROPERTY_RULE_TYPES = "rule_types"; + private List ruleTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_SEVERITIES = "severities"; + private List severities = null; + + public Rule() {} + + @JsonCreator + public Rule( + @JsonProperty(required = true, value = JSON_PROPERTY_ISSUE_TYPE) IssueType issueType, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE_TYPES) + List ruleTypes) { + this.issueType = issueType; + this.unparsed |= !issueType.isValid(); + this.ruleTypes = ruleTypes; + } + + public Rule issueType(IssueType issueType) { + this.issueType = issueType; + this.unparsed |= !issueType.isValid(); + return this; + } + + /** + * The type of issues on which the rule applies + * + * @return issueType + */ + @JsonProperty(JSON_PROPERTY_ISSUE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public IssueType getIssueType() { + return issueType; + } + + public void setIssueType(IssueType issueType) { + if (!issueType.isValid()) { + this.unparsed = true; + } + this.issueType = issueType; + } + + public Rule query(String query) { + this.query = query; + return this; + } + + /** + * The query is composed of one or several key:value pairs, which can be used to filter resources + * on tags and attributes. + * + * @return query + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + public Rule ruleIds(List ruleIds) { + this.ruleIds = ruleIds; + return this; + } + + public Rule addRuleIdsItem(String ruleIdsItem) { + if (this.ruleIds == null) { + this.ruleIds = new ArrayList<>(); + } + this.ruleIds.add(ruleIdsItem); + return this; + } + + /** + * Security rule ids + * + * @return ruleIds + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULE_IDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRuleIds() { + return ruleIds; + } + + public void setRuleIds(List ruleIds) { + this.ruleIds = ruleIds; + } + + public Rule ruleTypes(List ruleTypes) { + this.ruleTypes = ruleTypes; + return this; + } + + public Rule addRuleTypesItem(RuleTypesItems ruleTypesItem) { + this.ruleTypes.add(ruleTypesItem); + this.unparsed |= !ruleTypesItem.isValid(); + return this; + } + + /** + * Security rule types + * + * @return ruleTypes + */ + @JsonProperty(JSON_PROPERTY_RULE_TYPES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRuleTypes() { + return ruleTypes; + } + + public void setRuleTypes(List ruleTypes) { + this.ruleTypes = ruleTypes; + } + + public Rule severities(List severities) { + this.severities = severities; + return this; + } + + public Rule addSeveritiesItem(RuleSeverity severitiesItem) { + if (this.severities == null) { + this.severities = new ArrayList<>(); + } + this.severities.add(severitiesItem); + this.unparsed |= !severitiesItem.isValid(); + return this; + } + + /** + * The security rules severities to consider + * + * @return severities + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEVERITIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSeverities() { + return severities; + } + + public void setSeverities(List severities) { + this.severities = severities; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return Rule + */ + @JsonAnySetter + public Rule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Rule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Rule rule = (Rule) o; + return Objects.equals(this.issueType, rule.issueType) + && Objects.equals(this.query, rule.query) + && Objects.equals(this.ruleIds, rule.ruleIds) + && Objects.equals(this.ruleTypes, rule.ruleTypes) + && Objects.equals(this.severities, rule.severities) + && Objects.equals(this.additionalProperties, rule.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(issueType, query, ruleIds, ruleTypes, severities, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Rule {\n"); + sb.append(" issueType: ").append(toIndentedString(issueType)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" ruleIds: ").append(toIndentedString(ruleIds)).append("\n"); + sb.append(" ruleTypes: ").append(toIndentedString(ruleTypes)).append("\n"); + sb.append(" severities: ").append(toIndentedString(severities)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RuleSeverity.java b/src/main/java/com/datadog/api/client/v2/model/RuleSeverity.java new file mode 100644 index 00000000000..035fbd8f49a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RuleSeverity.java @@ -0,0 +1,59 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Severity of a security rule */ +@JsonSerialize(using = RuleSeverity.RuleSeveritySerializer.class) +public class RuleSeverity extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("critical", "high", "medium", "low", "unknown", "info")); + + public static final RuleSeverity CRITICAL = new RuleSeverity("critical"); + public static final RuleSeverity HIGH = new RuleSeverity("high"); + public static final RuleSeverity MEDIUM = new RuleSeverity("medium"); + public static final RuleSeverity LOW = new RuleSeverity("low"); + public static final RuleSeverity UNKNOWN = new RuleSeverity("unknown"); + public static final RuleSeverity INFO = new RuleSeverity("info"); + + RuleSeverity(String value) { + super(value, allowedValues); + } + + public static class RuleSeveritySerializer extends StdSerializer { + public RuleSeveritySerializer(Class t) { + super(t); + } + + public RuleSeveritySerializer() { + this(null); + } + + @Override + public void serialize(RuleSeverity value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RuleSeverity fromValue(String value) { + return new RuleSeverity(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RuleTypesItems.java b/src/main/java/com/datadog/api/client/v2/model/RuleTypesItems.java new file mode 100644 index 00000000000..463e660da34 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RuleTypesItems.java @@ -0,0 +1,73 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Security rule type */ +@JsonSerialize(using = RuleTypesItems.RuleTypesItemsSerializer.class) +public class RuleTypesItems extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "application_code_vulnerability", + "application_library_vulnerability", + "attack_path", + "container_image_vulnerability", + "host_vulnerability", + "identity_risk", + "misconfiguration", + "api_security")); + + public static final RuleTypesItems APPLICATION_CODE_VULNERABILITY = + new RuleTypesItems("application_code_vulnerability"); + public static final RuleTypesItems APPLICATION_LIBRARY_VULNERABILITY = + new RuleTypesItems("application_library_vulnerability"); + public static final RuleTypesItems ATTACK_PATH = new RuleTypesItems("attack_path"); + public static final RuleTypesItems CONTAINER_IMAGE_VULNERABILITY = + new RuleTypesItems("container_image_vulnerability"); + public static final RuleTypesItems HOST_VULNERABILITY = new RuleTypesItems("host_vulnerability"); + public static final RuleTypesItems IDENTITY_RISK = new RuleTypesItems("identity_risk"); + public static final RuleTypesItems MISCONFIGURATION = new RuleTypesItems("misconfiguration"); + public static final RuleTypesItems API_SECURITY = new RuleTypesItems("api_security"); + + RuleTypesItems(String value) { + super(value, allowedValues); + } + + public static class RuleTypesItemsSerializer extends StdSerializer { + public RuleTypesItemsSerializer(Class t) { + super(t); + } + + public RuleTypesItemsSerializer() { + this(null); + } + + @Override + public void serialize(RuleTypesItems value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static RuleTypesItems fromValue(String value) { + return new RuleTypesItems(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/RuleUser.java b/src/main/java/com/datadog/api/client/v2/model/RuleUser.java new file mode 100644 index 00000000000..e69baa164da --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/RuleUser.java @@ -0,0 +1,161 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** User creating or modifying a rule */ +@JsonPropertyOrder({RuleUser.JSON_PROPERTY_HANDLE, RuleUser.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class RuleUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public RuleUser handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The user handle. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public RuleUser name(String name) { + this.name = name; + return this; + } + + /** + * The user name. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return RuleUser + */ + @JsonAnySetter + public RuleUser putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this RuleUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RuleUser ruleUser = (RuleUser) o; + return Objects.equals(this.handle, ruleUser.handle) + && Objects.equals(this.name, ruleUser.name) + && Objects.equals(this.additionalProperties, ruleUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RuleUser {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateInboxRuleParameters.java b/src/main/java/com/datadog/api/client/v2/model/UpdateInboxRuleParameters.java new file mode 100644 index 00000000000..04ad8e864c9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateInboxRuleParameters.java @@ -0,0 +1,138 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Body of the inbox rule update request */ +@JsonPropertyOrder({UpdateInboxRuleParameters.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateInboxRuleParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateInboxRuleParametersData data; + + public UpdateInboxRuleParameters data(UpdateInboxRuleParametersData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the inbox rule update request: the rule id, the rule type, and the rule attributes. All + * fields are required. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateInboxRuleParametersData getData() { + return data; + } + + public void setData(UpdateInboxRuleParametersData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateInboxRuleParameters + */ + @JsonAnySetter + public UpdateInboxRuleParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateInboxRuleParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInboxRuleParameters updateInboxRuleParameters = (UpdateInboxRuleParameters) o; + return Objects.equals(this.data, updateInboxRuleParameters.data) + && Objects.equals( + this.additionalProperties, updateInboxRuleParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInboxRuleParameters {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateInboxRuleParametersData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateInboxRuleParametersData.java new file mode 100644 index 00000000000..d3655fbf2bc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateInboxRuleParametersData.java @@ -0,0 +1,216 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** + * Data of the inbox rule update request: the rule id, the rule type, and the rule attributes. All + * fields are required. + */ +@JsonPropertyOrder({ + UpdateInboxRuleParametersData.JSON_PROPERTY_ATTRIBUTES, + UpdateInboxRuleParametersData.JSON_PROPERTY_ID, + UpdateInboxRuleParametersData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateInboxRuleParametersData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateInboxRuleParametersDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private InboxRulesType type; + + public UpdateInboxRuleParametersData() {} + + @JsonCreator + public UpdateInboxRuleParametersData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CreateInboxRuleParametersDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InboxRulesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpdateInboxRuleParametersData attributes( + CreateInboxRuleParametersDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the inbox rule create request: the rule name, the rule details, the associated + * action, and the optional enabled field. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateInboxRuleParametersDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateInboxRuleParametersDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateInboxRuleParametersData id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of a pipeline rule + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public UpdateInboxRuleParametersData type(InboxRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to inbox rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InboxRulesType getType() { + return type; + } + + public void setType(InboxRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateInboxRuleParametersData + */ + @JsonAnySetter + public UpdateInboxRuleParametersData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateInboxRuleParametersData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInboxRuleParametersData updateInboxRuleParametersData = (UpdateInboxRuleParametersData) o; + return Objects.equals(this.attributes, updateInboxRuleParametersData.attributes) + && Objects.equals(this.id, updateInboxRuleParametersData.id) + && Objects.equals(this.type, updateInboxRuleParametersData.type) + && Objects.equals( + this.additionalProperties, updateInboxRuleParametersData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInboxRuleParametersData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateMuteRuleParameters.java b/src/main/java/com/datadog/api/client/v2/model/UpdateMuteRuleParameters.java new file mode 100644 index 00000000000..ec269e55dd3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateMuteRuleParameters.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Body of the mute rule update request */ +@JsonPropertyOrder({UpdateMuteRuleParameters.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateMuteRuleParameters { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private UpdateMuteRuleParametersData data; + + public UpdateMuteRuleParameters data(UpdateMuteRuleParametersData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data of the mute rule update request: the rule id, the rule type, and the rule attributes. All + * fields are required. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UpdateMuteRuleParametersData getData() { + return data; + } + + public void setData(UpdateMuteRuleParametersData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateMuteRuleParameters + */ + @JsonAnySetter + public UpdateMuteRuleParameters putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateMuteRuleParameters object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateMuteRuleParameters updateMuteRuleParameters = (UpdateMuteRuleParameters) o; + return Objects.equals(this.data, updateMuteRuleParameters.data) + && Objects.equals(this.additionalProperties, updateMuteRuleParameters.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateMuteRuleParameters {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/UpdateMuteRuleParametersData.java b/src/main/java/com/datadog/api/client/v2/model/UpdateMuteRuleParametersData.java new file mode 100644 index 00000000000..799d54b3e5f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/UpdateMuteRuleParametersData.java @@ -0,0 +1,216 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** + * Data of the mute rule update request: the rule id, the rule type, and the rule attributes. All + * fields are required. + */ +@JsonPropertyOrder({ + UpdateMuteRuleParametersData.JSON_PROPERTY_ATTRIBUTES, + UpdateMuteRuleParametersData.JSON_PROPERTY_ID, + UpdateMuteRuleParametersData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class UpdateMuteRuleParametersData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateMuteRuleParametersDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MuteRulesType type; + + public UpdateMuteRuleParametersData() {} + + @JsonCreator + public UpdateMuteRuleParametersData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CreateMuteRuleParametersDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MuteRulesType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public UpdateMuteRuleParametersData attributes( + CreateMuteRuleParametersDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the mute rule create request: the rule name, the rule details, the associated + * action, and the optional enabled field. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateMuteRuleParametersDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateMuteRuleParametersDataAttributes attributes) { + this.attributes = attributes; + } + + public UpdateMuteRuleParametersData id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of a pipeline rule + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getId() { + return id; + } + + public void setId(UUID id) { + this.id = id; + } + + public UpdateMuteRuleParametersData type(MuteRulesType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The pipeline rule type associated to mute rules + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRulesType getType() { + return type; + } + + public void setType(MuteRulesType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return UpdateMuteRuleParametersData + */ + @JsonAnySetter + public UpdateMuteRuleParametersData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this UpdateMuteRuleParametersData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateMuteRuleParametersData updateMuteRuleParametersData = (UpdateMuteRuleParametersData) o; + return Objects.equals(this.attributes, updateMuteRuleParametersData.attributes) + && Objects.equals(this.id, updateMuteRuleParametersData.id) + && Objects.equals(this.type, updateMuteRuleParametersData.type) + && Objects.equals( + this.additionalProperties, updateMuteRuleParametersData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateMuteRuleParametersData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/cassettes/features/v1/Create_a_user_returns_User_created_response_test.json b/src/test/resources/cassettes/features/v1/Create_a_user_returns_User_created_response_test.json index 42def371a51..b676df880e6 100644 --- a/src/test/resources/cassettes/features/v1/Create_a_user_returns_User_created_response_test.json +++ b/src/test/resources/cassettes/features/v1/Create_a_user_returns_User_created_response_test.json @@ -53,6 +53,6 @@ "timeToLive": { "unlimited": true }, - "id": "af617072-2860-ba27-e045-b00c8baf0187" + "id": "af617072-2860-ba27-e045-b00c8baf0188" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Create_a_user_returns_null_access_role.json b/src/test/resources/cassettes/features/v1/Create_a_user_returns_null_access_role.json index 5a17eb5f03a..e5b3fe6bcf6 100644 --- a/src/test/resources/cassettes/features/v1/Create_a_user_returns_null_access_role.json +++ b/src/test/resources/cassettes/features/v1/Create_a_user_returns_null_access_role.json @@ -53,6 +53,6 @@ "timeToLive": { "unlimited": true }, - "id": "af617072-2860-ba27-e045-b00c8baf0188" + "id": "af617072-2860-ba27-e045-b00c8baf0187" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json index dbf89c929d7..0b1cdf6a6a8 100644 --- a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json +++ b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_deserializes_successfully.json @@ -28,6 +28,6 @@ "timeToLive": { "unlimited": true }, - "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d" + "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json index e94edfb7099..91c8275f382 100644 --- a/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v1/Get_all_hosts_with_metadata_for_your_organization_returns_OK_response.json @@ -28,6 +28,6 @@ "timeToLive": { "unlimited": true }, - "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31e" + "id": "d5bade64-6ebb-4f4d-903d-8069b52bb31d" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.json index bc99e6e9183..97e4959085e 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_AWS_Account_object_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "c206b9cd-771e-14f0-5d18-42a3a48556cf" + "id": "c206b9cd-771e-14f0-5d18-42a3a48556ce" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.json index 6015d51bb66..6d507bcd8cb 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Bad_Request_response.json @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "f1ca6244-e46c-b3a2-86bf-65d4e9044ba5" + "id": "f1ca6244-e46c-b3a2-86bf-65d4e9044ba4" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.json index b708f569ef9..8b502f67b92 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Create_account_config_returns_Conflict_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eed" + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eeb" }, { "httpRequest": { @@ -57,7 +57,7 @@ "timeToLive": { "unlimited": true }, - "id": "c206b9cd-771e-14f0-5d18-42a3a48556d0" + "id": "c206b9cd-771e-14f0-5d18-42a3a48556cf" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.json index a42ef29bfae..c82b6c27f29 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Bad_Request_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "73fd406e-d686-10bd-50ee-83f2c499e8a8" + "id": "73fd406e-d686-10bd-50ee-83f2c499e8a9" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.json index 9d1776285d2..7c4ece93315 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Delete_account_config_returns_Not_Found_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eeb" + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eed" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2123e3-6fb5-0f90-fe98-365e086c9c6e" + "id": "ab2123e3-6fb5-0f90-fe98-365e086c9c6f" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.json index 7bf88c684fb..efb480e06b4 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Generate_new_external_ID_returns_AWS_External_ID_object_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "a3ebb722-60eb-fa89-589a-ff3630e3a2ce" + "id": "a3ebb722-60eb-fa89-589a-ff3630e3a2cc" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.json index 70fc4d3589b..bb9830f6a8c 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_AWS_Account_object_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eec" + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9ee9" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.json index 6352d5f0102..87cb96a7640 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Bad_Request_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "3d4d0603-9fed-1cc5-8004-086b9b6ef691" + "id": "3d4d0603-9fed-1cc5-8004-086b9b6ef690" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.json index 7e5c7b1234d..55368f4ae1c 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Get_account_config_returns_Not_Found_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "9b33b83c-c8bb-714f-cf71-33ab2f3af9d3" + "id": "9b33b83c-c8bb-714f-cf71-33ab2f3af9d4" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.json index 96ea2f1d661..994e56ed9eb 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_List_available_namespaces_returns_AWS_Namespaces_List_object_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d0f" + "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d11" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.json index e05cab1201f..266b281e690 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_List_log_services_returns_AWS_Logs_Services_List_object_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "03c3c0d9-a62f-5ac6-398b-e22a05d14d7b" + "id": "03c3c0d9-a62f-5ac6-398b-e22a05d14d7a" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.json index 7711ea26b7b..96ea2f1d661 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_List_namespaces_returns_AWS_Namespaces_List_object_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d0e" + "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d0f" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.json index 1080a831ec7..520c88368e3 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_AWS_Account_object_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eea" + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eec" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.json index 77aa5204b9c..594ead3b0a2 100644 --- a/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/AWS_Integration_Patch_account_config_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9ee9" + "id": "194b15fb-fcae-9b9a-e1a7-0daa19dc9eea" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.json index 1522bfacf43..ffce7b80afa 100644 --- a/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Archive_case_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a94" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a97" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.json index 440104db9b6..dbc24356eac 100644 --- a/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Archive_case_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a91" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a98" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.json index b8fc6d4a6de..02df6bbc6d7 100644 --- a/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Assign_case_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a98" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a95" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.json index 484474862c3..f37d83f9c9b 100644 --- a/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Assign_case_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a92" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a8d" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Cancel_a_historical_job_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Cancel_a_historical_job_returns_OK_response.json index 3c8e972d500..73b6c147c8c 100644 --- a/src/test/resources/cassettes/features/v2/Cancel_a_historical_job_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Cancel_a_historical_job_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "6bb82102-e994-f0d1-ee96-e1e3f1d80ffe" + "id": "6bb82102-e994-f0d1-ee96-e1e3f1d80ffd" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.json index cfae7af1511..94ffd01c024 100644 --- a/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Cancels_a_data_deletion_request_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "516e2b97-25f6-b08c-4d4a-1da22948b32f" + "id": "516e2b97-25f6-b08c-4d4a-1da22948b330" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json index bfdd0f4a94d..31da0312ba7 100644 --- a/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_Scanning_Group_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7c" + "id": "01611a93-5e74-0630-3c51-f707c3b51e79" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json index 5ae70163d38..945fea90a6b 100644 --- a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_Bad_Request_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7f" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7d" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15d" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15b" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json index 176e35c555b..78115de3e31 100644 --- a/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Create_Scanning_Rule_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e82" + "id": "01611a93-5e74-0630-3c51-f707c3b51e81" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed160" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15f" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..10159685ee0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:40:24.310Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..3e7fa21a2b7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}}}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"\\\" expected one of \\\"inbox_rules\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fdbd89c8-7513-7763-aa35-9650ea5170b2" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Successfully_created_the_inbox_rule_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Successfully_created_the_inbox_rule_response.freeze new file mode 100644 index 00000000000..18e27819e0d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Successfully_created_the_inbox_rule_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:40:24.671Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Successfully_created_the_inbox_rule_response.json b/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Successfully_created_the_inbox_rule_response.json new file mode 100644 index 00000000000..3cceac6d561 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_new_inbox_rule_returns_Successfully_created_the_inbox_rule_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"9699508b-4736-416c-a8a7-1b7343eb9d42\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1737621625085,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621625085,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "83ae2d6c-7906-928d-0f93-0178a0e3fddf" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/9699508b-4736-416c-a8a7-1b7343eb9d42", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5aeb1727-26bb-6f75-8b9c-8763c0af2c3c" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..ce25e954323 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:40:58.713Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..fe6755d42b5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Bad_Request_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"expire_at\":1893452400000,\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}}}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"got type \\\"\\\" expected one of \\\"mute_rules\\\"\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4ddefa41-3de6-2e1c-ef2a-59df16c1cdd6" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Successfully_created_the_mute_rule_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Successfully_created_the_mute_rule_response.freeze new file mode 100644 index 00000000000..3f78331241e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Successfully_created_the_mute_rule_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:40:59.068Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Successfully_created_the_mute_rule_response.json b/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Successfully_created_the_mute_rule_response.json new file mode 100644 index 00000000000..ea6a9df7539 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_new_mute_rule_returns_Successfully_created_the_mute_rule_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"expire_at\":1893452400000,\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"f5497c52-4c9b-4a2c-bf17-0a506827464e\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\",\"expire_at\":1893452400000},\"created_at\":1737639659503,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639659503,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6f6c0e9c-e6a4-44fe-339c-e21281097eb8" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/f5497c52-4c9b-4a2c-bf17-0a506827464e", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "45f73a46-3da7-50bf-1ed4-39c7ef73837a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json index 817259ad455..10196fccfbe 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_account_returns_AWS_Account_object_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "c206b9cd-771e-14f0-5d18-42a3a48556ce" + "id": "c206b9cd-771e-14f0-5d18-42a3a48556d0" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json index 6d507bcd8cb..6015d51bb66 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Bad_Request_response.json @@ -27,6 +27,6 @@ "timeToLive": { "unlimited": true }, - "id": "f1ca6244-e46c-b3a2-86bf-65d4e9044ba4" + "id": "f1ca6244-e46c-b3a2-86bf-65d4e9044ba5" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json index 7c10d314d40..3756dc5e601 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_AWS_integration_returns_Conflict_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "cd59362c-7df2-d349-9880-5b5536151a0a" + "id": "cd59362c-7df2-d349-9880-5b5536151a0b" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Create_an_incident_type_returns_CREATED_response.json b/src/test/resources/cassettes/features/v2/Create_an_incident_type_returns_CREATED_response.json index 80f4749b434..e8d8aa376d6 100644 --- a/src/test/resources/cassettes/features/v2/Create_an_incident_type_returns_CREATED_response.json +++ b/src/test/resources/cassettes/features/v2/Create_an_incident_type_returns_CREATED_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd2" + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd1" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_App_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_App_returns_OK_response.json index e3cb9ef2d6d..d2c66e26e59 100644 --- a/src/test/resources/cassettes/features/v2/Delete_App_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_App_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "820bad24-1ae4-7d45-b443-7591eb8052c1" + "id": "820bad24-1ae4-7d45-b443-7591eb8052bf" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_Multiple_Apps_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_Multiple_Apps_returns_OK_response.json index b601cdafd19..29c5d045f1a 100644 --- a/src/test/resources/cassettes/features/v2/Delete_Multiple_Apps_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_Multiple_Apps_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "820bad24-1ae4-7d45-b443-7591eb8052c3" + "id": "820bad24-1ae4-7d45-b443-7591eb8052bd" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json index d131935d0a6..bd84fafc3cc 100644 --- a/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_Scanning_Group_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7a" + "id": "01611a93-5e74-0630-3c51-f707c3b51e82" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15a" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed160" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json index de95dd66c57..1f3fb9b0ccb 100644 --- a/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_Scanning_Rule_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e83" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7c" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed161" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15a" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..bf323f82b6e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:02.850Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Not_Found_response.json new file mode 100644 index 00000000000..444cc2b8f3e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dabb433e-cbb9-2227-9356-0fdc9b49abf6" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Rule_successfully_deleted_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Rule_successfully_deleted_response.freeze new file mode 100644 index 00000000000..adb4a014aef --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Rule_successfully_deleted_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:03.310Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Rule_successfully_deleted_response.json b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Rule_successfully_deleted_response.json new file mode 100644 index 00000000000..b6cb55b994f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Rule_successfully_deleted_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"enabled\":true,\"name\":\"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1737639663\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ba7a16f1-4f80-417d-a868-6b5f14dd3328\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639663734,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639663734,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1737639663\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c080f5ad-7312-ed05-4eab-ce29e20d5979" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/ba7a16f1-4f80-417d-a868-6b5f14dd3328", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8bdd6f32-abc0-408b-a549-ce4945b37703" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/ba7a16f1-4f80-417d-a868-6b5f14dd3328", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8bdd6f32-abc0-408b-a549-ce4945b37704" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_retention_filter_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_a_retention_filter_returns_OK_response.json index f4924fa1a3a..0d7a178583b 100644 --- a/src/test/resources/cassettes/features/v2/Delete_a_retention_filter_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_a_retention_filter_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0697" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0698" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.json index c82b6c27f29..a42ef29bfae 100644 --- a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Bad_Request_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "73fd406e-d686-10bd-50ee-83f2c499e8a9" + "id": "73fd406e-d686-10bd-50ee-83f2c499e8a8" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.json b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.json index 7897e338686..e060b9aec6b 100644 --- a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_No_Content_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "cd59362c-7df2-d349-9880-5b5536151a06" + "id": "cd59362c-7df2-d349-9880-5b5536151a08" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.json index 2793e9f3e53..05cea677503 100644 --- a/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_an_AWS_integration_returns_Not_Found_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "cd59362c-7df2-d349-9880-5b5536151a08" + "id": "cd59362c-7df2-d349-9880-5b5536151a06" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2123e3-6fb5-0f90-fe98-365e086c9c6f" + "id": "ab2123e3-6fb5-0f90-fe98-365e086c9c6e" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..c04a6bdec53 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:40:36.673Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Not_Found_response.json new file mode 100644 index 00000000000..118a0912e83 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1bea2c4e-92be-886d-a89f-9dd47ad5a343" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Rule_successfully_deleted_response.freeze b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Rule_successfully_deleted_response.freeze new file mode 100644 index 00000000000..83caacd996f --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Rule_successfully_deleted_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:40:37.024Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Rule_successfully_deleted_response.json b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Rule_successfully_deleted_response.json new file mode 100644 index 00000000000..3d68add0a19 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Rule_successfully_deleted_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"enabled\":true,\"name\":\"Test-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1737621637\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6d6379c8-16a2-42a0-9119-5a76c0d947fc\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621637438,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621637438,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1737621637\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1527f769-4bce-3acf-804b-07796afadba8" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/6d6379c8-16a2-42a0-9119-5a76c0d947fc", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "57f12b3b-9773-eca7-1b25-5b20645005c2" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/6d6379c8-16a2-42a0-9119-5a76c0d947fc", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "57f12b3b-9773-eca7-1b25-5b20645005c3" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_an_incident_type_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Delete_an_incident_type_returns_OK_response.json index a7907e6f95b..8795d36c42f 100644 --- a/src/test/resources/cassettes/features/v2/Delete_an_incident_type_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Delete_an_incident_type_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd3" + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd2" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Deploy_App_returns_Created_response.json b/src/test/resources/cassettes/features/v2/Deploy_App_returns_Created_response.json index 7b03241561d..e0e5541f7fe 100644 --- a/src/test/resources/cassettes/features/v2/Deploy_App_returns_Created_response.json +++ b/src/test/resources/cassettes/features/v2/Deploy_App_returns_Created_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "820bad24-1ae4-7d45-b443-7591eb8052bd" + "id": "820bad24-1ae4-7d45-b443-7591eb8052be" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Disable_App_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Disable_App_returns_OK_response.json index e43d674f141..1733d82ec98 100644 --- a/src/test/resources/cassettes/features/v2/Disable_App_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Disable_App_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "820bad24-1ae4-7d45-b443-7591eb8052c0" + "id": "820bad24-1ae4-7d45-b443-7591eb8052c2" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.json b/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.json index a75b3a73a8e..77b1c5f9c48 100644 --- a/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.json +++ b/src/test/resources/cassettes/features/v2/Generate_a_new_external_ID_returns_AWS_External_ID_object_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "a3ebb722-60eb-fa89-589a-ff3630e3a2cc" + "id": "a3ebb722-60eb-fa89-589a-ff3630e3a2ce" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_App_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_App_returns_OK_response.json index 6b20617c6cf..d850a2dc18d 100644 --- a/src/test/resources/cassettes/features/v2/Get_App_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_App_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "820bad24-1ae4-7d45-b443-7591eb8052be" + "id": "820bad24-1ae4-7d45-b443-7591eb8052c1" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_a_given_APM_retention_filter_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_given_APM_retention_filter_returns_OK_response.json index bdbb5ca5574..9cbcc541e46 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_given_APM_retention_filter_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_a_given_APM_retention_filter_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0698" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069b" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_a_job_s_details_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_a_job_s_details_returns_OK_response.json index 97d8aaf36a1..7da31f7f5a9 100644 --- a/src/test/resources/cassettes/features/v2/Get_a_job_s_details_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_a_job_s_details_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "6bb82102-e994-f0d1-ee96-e1e3f1d80ffd" + "id": "6bb82102-e994-f0d1-ee96-e1e3f1d80ffe" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Get_all_rules_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_all_rules_returns_OK_response.json index e1d7d6dfa5f..6e336f005de 100644 --- a/src/test/resources/cassettes/features/v2/Get_all_rules_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Get_all_rules_returns_OK_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "7e2e839d-ac73-21dc-b480-36e366ae09da" + "id": "7e2e839d-ac73-21dc-b480-36e366ae09d9" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.json index 87cb96a7640..6352d5f0102 100644 --- a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Bad_Request_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "3d4d0603-9fed-1cc5-8004-086b9b6ef690" + "id": "3d4d0603-9fed-1cc5-8004-086b9b6ef691" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.json index 55368f4ae1c..7e5c7b1234d 100644 --- a/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.json +++ b/src/test/resources/cassettes/features/v2/Get_an_AWS_integration_by_config_ID_returns_Not_Found_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "9b33b83c-c8bb-714f-cf71-33ab2f3af9d4" + "id": "9b33b83c-c8bb-714f-cf71-33ab2f3af9d3" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..69d2f61dc59 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:21.694Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..6719dfd4f1a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/invalid-uuid", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"ruleId not a valid UUID\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "7cf2d733-6752-a5f7-81e1-53a72626f29d" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Mute_rule_details_response.freeze b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Mute_rule_details_response.freeze new file mode 100644 index 00000000000..cc80c8a24b4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Mute_rule_details_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:22.134Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Mute_rule_details_response.json b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Mute_rule_details_response.json new file mode 100644 index 00000000000..cc858d28044 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Mute_rule_details_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"enabled\":true,\"name\":\"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1737639682\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"54f22733-b8d8-4b02-9b93-a9e608dfd489\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639682560,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639682560,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1737639682\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5bf97d7b-c49a-9504-b312-54abc37df248" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/54f22733-b8d8-4b02-9b93-a9e608dfd489", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"54f22733-b8d8-4b02-9b93-a9e608dfd489\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639682560,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639682560,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1737639682\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "34df0f68-7516-e9a0-439a-2f3e2e5cb060" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/54f22733-b8d8-4b02-9b93-a9e608dfd489", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4c121e6c-3e3d-bdd7-3d51-17b885ec8871" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..fe145d2ba37 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:23.432Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Not_Found_response.json new file mode 100644 index 00000000000..d28cd2c4985 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_a_mute_rule_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2ab5b10b-d20f-c768-6291-4e6a8a24cd33" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..120578100b1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:40:49.949Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..9d27d599c31 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Bad_Request_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/invalid-uuid", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"ruleId not a valid UUID\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6b4a0f26-88f9-4597-7cda-d403ef860e85" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response.freeze b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response.freeze new file mode 100644 index 00000000000..f28a13e3a99 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:40:50.399Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response.json b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response.json new file mode 100644 index 00000000000..f4729713684 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"enabled\":true,\"name\":\"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1737621650\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"77f32ef7-0abb-40cd-a36e-51a19999c78a\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621650715,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621650715,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1737621650\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5afddbb0-7be5-5f5d-4861-7b423b1679be" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/77f32ef7-0abb-40cd-a36e-51a19999c78a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"77f32ef7-0abb-40cd-a36e-51a19999c78a\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621650715,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621650715,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1737621650\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "61cd4214-9225-45e0-1163-4ca04a131875" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/77f32ef7-0abb-40cd-a36e-51a19999c78a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c8830de9-466a-78c3-4319-682c64953469" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..21366f01877 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:40:51.721Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Not_Found_response.json new file mode 100644 index 00000000000..db1208cd231 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_details_of_an_inbox_rule_returns_Not_Found_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "da0128e4-c2ea-f8e6-6da8-07d516d17f46" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response.freeze new file mode 100644 index 00000000000..1403a614964 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:40:52.068Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response.json b/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response.json new file mode 100644 index 00000000000..1291f395755 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"enabled\":true,\"name\":\"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1737621652\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"82c9b4a9-d362-46fb-b143-aadc4b89a98d\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621652480,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621652480,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1737621652\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a022b983-7378-bd05-18dc-78532109fb72" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"720e23e6-3aa2-4792-9dff-df02f86676ad\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736869747695,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736869747695,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1736869747\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"307d8a2f-a82d-4272-9d38-6a859251d0a6\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736936332401,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736936332401,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_an_inbox_rule_returns_Bad_Request_response-1736936332\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"9e4361c5-e21b-4e59-90ae-57214151b2b2\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736936704349,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736936704349,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1736936704\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"1ad42562-e1be-4ec2-a510-6923e6d708a4\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736937094878,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736937094878,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1736937094\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"2ce28a6e-0975-48cc-9bff-de1a9edd94e2\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736937364153,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736937364153,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1736937363\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"bd638ded-e784-48c9-87bf-a3de72138f44\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1736938273788,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736938274279,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}},{\"id\":\"6717872d-9ac1-4570-8480-720b0f6f3193\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1736938776235,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736938776235,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}},{\"id\":\"1b50cdb7-5218-4989-9afc-e0d144d642e2\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736938883731,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736938883731,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1736938883\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"b6ea190b-0317-40ba-a7ad-844e1e89a767\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736939052699,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736939052699,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1736939052\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"4f18dc53-d185-44d4-846c-561ec59bbf72\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1736952258489,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736952258489,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}},{\"id\":\"0294b7cd-ecf4-4e30-bf00-542e53e9918b\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736952539376,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736952539376,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1736952538\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"5e57a84a-a64e-4551-8c70-71e164df56ea\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1736952677206,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736952677695,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}},{\"id\":\"8db7bc0b-0ff9-4936-8eba-32ff56c42f0d\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736953111545,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736953111545,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1736953111\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"754ec766-45e1-4617-92f2-2c685640cfa5\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736953380911,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736953380911,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1736953380\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"5e7dd814-ba12-4536-be51-b29aa3dff555\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1736953540702,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736953541190,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}},{\"id\":\"9a53ae69-e980-4088-b57c-260f07da4706\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736953562530,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736953562530,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1736953562\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"b6525132-929b-4c7a-ad7e-c51b66521219\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736955793842,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736955793842,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1736955793\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"f4e5ffe8-b035-4f0e-9fdb-34fc3cbe1d68\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736956113141,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736956113141,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1736956112\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"fdc17395-9f98-4b1f-9643-21642074109c\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736956188814,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736956188814,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_an_inbox_rule_returns_Bad_Request_response-1736956188\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"0d0010f5-0255-46ff-94ac-ae52239d6369\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736957603847,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736957603847,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_an_inbox_rule_returns_Bad_Request_response-1736957603\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"4079ea57-aa2a-4da6-b7b9-1f186492dc6c\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1736972574272,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736972574272,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1736972573\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"82c9b4a9-d362-46fb-b143-aadc4b89a98d\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621652480,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621652480,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1737621652\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b7d1fed1-bea0-6aef-b14a-2e3b1151c0d9" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/82c9b4a9-d362-46fb-b143-aadc4b89a98d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f5d59900-67dd-15e9-1d5c-f73de89cf7cc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response.freeze b/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response.freeze new file mode 100644 index 00000000000..617ca30f59a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:27.633Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response.json b/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response.json new file mode 100644 index 00000000000..33f0828cfcf --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"enabled\":true,\"name\":\"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1737639687\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"7b381b30-fc50-47fb-95a0-0fb56b1f9b58\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639688054,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639688054,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1737639687\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6d32dbd3-25a9-dabf-2d9a-675ef9affa45" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"4601dcaf-d7ee-40ef-9ce5-7eed3a83f69a\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736870838826,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736870838826,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1736870838\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"a479725a-8692-42d0-bf9c-0d63ca642345\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"created_at\":1736873422906,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736873422906,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}},{\"id\":\"48589a8d-1a79-443a-8b05-11209ac9be54\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736931543287,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736931543287,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1736931542\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"cb8e7dec-f5fa-4d20-b731-21d7685e3084\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736931564718,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736931564718,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1736931564\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"714e8c5d-1d83-4646-968d-35586ad7ddc4\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736931593302,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736931593302,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736931592\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"aec50bc5-e9c0-4101-953e-0f87d5138c10\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736931614635,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736931614635,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736931614\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"9e2d8004-e866-47d3-8e47-069051522e60\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"created_at\":1736934594769,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736934594769,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}},{\"id\":\"1f0eda8c-86a3-4670-889b-4f95d47445e1\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736934778778,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736934778778,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736934778\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"128ceab0-9c15-4421-be66-f5131b171755\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736934800187,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736934800187,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736934799\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"cca4499a-19c3-4642-af33-2051458b9e80\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736935335347,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736935335347,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1736935334\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"b77f1a5f-0aeb-4ed7-8451-d9d3f0eef4a0\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736935380165,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736935380165,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1736935379\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"009b952a-5ae5-45ea-bf4c-5b42cd414739\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736935847643,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736935847643,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_a_mute_rule_returns_Bad_Request_response-1736935847\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"82563439-591a-4a2f-9061-eddf0f30cc40\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736936710612,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736936710612,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736936710\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"2d2b5a1d-8bb4-440c-a95c-8e4fef7ac478\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736938961065,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736938961065,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736938960\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"fb6be9d0-fe60-449a-91b2-5a2647ea9b45\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736952343752,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736952343752,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1736952343\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"8eaf899d-519f-430e-a03f-bf0001259a78\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736952429326,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736952429326,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1736952428\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"5e08217f-eca0-4502-ac23-3d6490d8cd66\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\",\"expire_at\":1893452400000},\"created_at\":1736952606711,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736952607199,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}},{\"id\":\"11ec6d30-e044-487e-b560-83e17e571001\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736952628631,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736952628631,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736952628\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"746e3593-b6ba-4fcd-b100-7d298b4c6454\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"created_at\":1736953059610,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736953059610,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}},{\"id\":\"2ef91fd4-4e8f-4f47-8745-58cff2874da7\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736953256564,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736953256564,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_a_mute_rule_returns_Bad_Request_response-1736953256\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"dfc987db-7584-4f48-9e80-f5ba91145132\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736953277997,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736953277997,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1736953277\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"1d1e9077-8c7d-44b4-9a5e-6f3f9e516ff0\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736953429788,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736953429788,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736953429\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"ab5208f6-88d2-4bd4-9392-a0020b9fec60\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736953491759,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736953491759,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736953491\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"3ffd9263-0460-4cd8-95ca-0f1e43624490\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736954925280,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736954925280,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1736954924\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"690679b5-99e9-46ed-a11e-ce03915fe063\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736955128456,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736955128456,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1736955128\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"c151d2d4-5917-4d83-bb60-e82eecaf36a1\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736956108775,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736956108775,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1736956108\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"c5c3dcfa-b30b-4db6-8fd8-60c96cb94bac\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736963169276,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736963169276,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_Bad_Request_response-1736963168\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"45d5d101-eb05-4dc2-926b-079900bb7ad6\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1736970911790,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1736970911790,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Typescript-Update_a_mute_rule_returns_Bad_Request_response-1736970911\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}},{\"id\":\"7b381b30-fc50-47fb-95a0-0fb56b1f9b58\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639688054,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639688054,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1737639687\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e54b3612-bb4e-a4b5-5597-e66a4aa708f6" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/7b381b30-fc50-47fb-95a0-0fb56b1f9b58", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "59b4d334-dcaa-6f84-547d-b67392ddb299" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.json index 6ab71e5cb0b..1eccad92176 100644 --- a/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Gets_a_list_of_data_deletion_requests_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "516e2b97-25f6-b08c-4d4a-1da22948b330" + "id": "516e2b97-25f6-b08c-4d4a-1da22948b32f" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Grant_permission_to_a_role_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Grant_permission_to_a_role_returns_OK_response.json index 77b4efafa68..d1447e359b2 100644 --- a/src/test/resources/cassettes/features/v2/Grant_permission_to_a_role_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Grant_permission_to_a_role_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892170" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216c" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json index cee16ffedd5..3d0ccf67cf8 100644 --- a/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_Scanning_Groups_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7d" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7a" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15c" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed159" }, { "httpRequest": { @@ -79,7 +79,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7e" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7b" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_all_APM_retention_filters_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_all_APM_retention_filters_returns_OK_response.json index a45482c1f6c..0e57fd24aec 100644 --- a/src/test/resources/cassettes/features/v2/List_all_APM_retention_filters_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_all_APM_retention_filters_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069b" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069a" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_all_rules_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_all_rules_returns_OK_response.json index 80e2da9ecca..2cd151adcdb 100644 --- a/src/test/resources/cassettes/features/v2/List_all_rules_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_all_rules_returns_OK_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "7e2e839d-ac73-21dc-b480-36e366ae09d9" + "id": "7e2e839d-ac73-21dc-b480-36e366ae09da" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.json b/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.json index 266b281e690..e05cab1201f 100644 --- a/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.json +++ b/src/test/resources/cassettes/features/v2/List_log_services_returns_AWS_Logs_Services_List_object_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "03c3c0d9-a62f-5ac6-398b-e22a05d14d7a" + "id": "03c3c0d9-a62f-5ac6-398b-e22a05d14d7b" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.json b/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.json index a179615718f..adf7e6ef2ed 100644 --- a/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.json +++ b/src/test/resources/cassettes/features/v2/List_namespaces_returns_AWS_Namespaces_List_object_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d11" + "id": "d0ec7736-ef6c-d071-3390-4a5c3a301d0e" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_permissions_for_a_role_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_permissions_for_a_role_returns_OK_response.json index f27b1bc88fb..3d75a2e2292 100644 --- a/src/test/resources/cassettes/features/v2/List_permissions_for_a_role_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_permissions_for_a_role_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892174" + "id": "ab2c08c1-60c7-9278-3246-d650bb892173" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json index 8b5185d00c4..b11612d8018 100644 --- a/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/List_permissions_returns_OK_response.json @@ -23,6 +23,6 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216d" + "id": "ab2c08c1-60c7-9278-3246-d650bb892172" } ] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response.freeze b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response.freeze new file mode 100644 index 00000000000..61240646a70 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:33.878Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response.json b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response.json new file mode 100644 index 00000000000..2a94a98a694 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"enabled\":true,\"name\":\"Test-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1737639693\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"e1af2efd-e6c3-42a7-b0d5-b1250be228f5\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639694186,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639694186,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1737639693\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dc2dec88-4251-1b25-86aa-606f90b753e1" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"expire_at\":1893452400000,\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"e1af2efd-e6c3-42a7-b0d5-b1250be228f5\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/e1af2efd-e6c3-42a7-b0d5-b1250be228f5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"e1af2efd-e6c3-42a7-b0d5-b1250be228f5\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\",\"expire_at\":1893452400000},\"created_at\":1737639694186,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639694642,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3ca1d526-ca9c-efcc-798a-10945f19098f" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/e1af2efd-e6c3-42a7-b0d5-b1250be228f5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bed70ba7-b622-cdb8-eea7-4d978a95137a" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..11a478123e5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:35.168Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Not_Found_response.json new file mode 100644 index 00000000000..558661e743d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"expire_at\":1893452400000,\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"00000000-0000-0000-0000-426655000000\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2a3c49d0-812e-8ecd-456d-302a90cd8bf0" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze new file mode 100644 index 00000000000..e7595f2f4a2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:35.525Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json new file mode 100644 index 00000000000..f3f99935fef --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"enabled\":true,\"name\":\"Test-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1737639695\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"887dda05-1701-4530-b21e-0608692270bb\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639695933,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639695933,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1737639695\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e35322c8-28a6-15f7-4dc2-f43dd66eba0e" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"expire_at\":1893452400000,\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"00000000-0000-0000-0000-426655000000\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/887dda05-1701-4530-b21e-0608692270bb", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"422\",\"title\":\"Unprocessable Entity\",\"detail\":\"Rule Ids in path and in request body differ\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 422, + "reasonPhrase": "Unprocessable Entity" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c9c4c0cf-9397-56b5-b256-3711eee8af0e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/887dda05-1701-4530-b21e-0608692270bb", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c1e39b49-f4f8-a062-5cf5-27a397acb1af" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..cf45b6d83fe --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:41:03.189Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..b59e6686b21 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Bad_Request_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"enabled\":true,\"name\":\"Test-Patch_an_inbox_rule_returns_Bad_Request_response-1737621663\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b9b74321-b7e6-4b06-b0cf-c3670962467b\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621663602,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621663602,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Patch_an_inbox_rule_returns_Bad_Request_response-1737621663\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f7b0cb34-d050-0d9b-4622-3eea825a3ff9" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"invalid\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"b9b74321-b7e6-4b06-b0cf-c3670962467b\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/b9b74321-b7e6-4b06-b0cf-c3670962467b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"Error while unmarshalling JSON API request\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "08ad8f8e-cc67-7428-a7d9-cd33145f6d64" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/b9b74321-b7e6-4b06-b0cf-c3670962467b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d6436827-fd7c-0777-5fb4-7a6776ce0543" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response.freeze b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response.freeze new file mode 100644 index 00000000000..7c42250c792 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:41:04.479Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response.json b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response.json new file mode 100644 index 00000000000..c3219cae7a2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"enabled\":true,\"name\":\"Test-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1737621664\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"1a524ec9-504d-4aa0-9c81-52a994cfe8c1\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621664886,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621664886,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1737621664\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c9cb2765-3add-a7e5-5f62-7d30e9ceb019" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"1a524ec9-504d-4aa0-9c81-52a994cfe8c1\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/1a524ec9-504d-4aa0-9c81-52a994cfe8c1", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"1a524ec9-504d-4aa0-9c81-52a994cfe8c1\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1737621664886,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621665366,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e5e1fa61-838f-0fca-10a9-a60b7c84d9ae" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/1a524ec9-504d-4aa0-9c81-52a994cfe8c1", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "11d12271-d243-4065-42df-adca759fa936" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..ee50e94ff1c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:41:05.792Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Not_Found_response.json new file mode 100644 index 00000000000..82ee8835492 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"00000000-0000-0000-0000-426655000000\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b0dc441c-178d-290b-6fad-a30419e292ac" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze new file mode 100644 index 00000000000..f11dc3ee0e3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:41:06.264Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json new file mode 100644 index 00000000000..70652d75d51 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"enabled\":true,\"name\":\"Test-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1737621666\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"1068be59-ede3-4937-a632-e99800fae69d\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621666672,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621666672,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1737621666\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "57d91e69-67e2-878e-85df-d58c84f52509" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"00000000-0000-0000-0000-426655000000\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/1068be59-ede3-4937-a632-e99800fae69d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"422\",\"title\":\"Unprocessable Entity\",\"detail\":\"Rule Ids in path and in request body differ\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 422, + "reasonPhrase": "Unprocessable Entity" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ca033d1e-9584-8537-3917-42f8a4ad59ea" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/1068be59-ede3-4937-a632-e99800fae69d", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3d57be58-579f-7f85-39f6-6ad816d903eb" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json index fccadae11ee..74fd42ce3ea 100644 --- a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_Bad_Request_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e79" + "id": "01611a93-5e74-0630-3c51-f707c3b51e83" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed159" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed161" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_OK_response.json index 02786482b07..06155248802 100644 --- a/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Reorder_Groups_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e80" + "id": "01611a93-5e74-0630-3c51-f707c3b51e78" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15e" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed158" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json index a6d6057cc63..d59c27e003b 100644 --- a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json +++ b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_Not_found_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb89216c" + "id": "ab2c08c1-60c7-9278-3246-d650bb892174" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json index c412cfe00ae..a8a7de74a9a 100644 --- a/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Revoke_permission_returns_OK_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892173" + "id": "ab2c08c1-60c7-9278-3246-d650bb892170" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.json index 5642e3dc46d..cfa2e05d9c5 100644 --- a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a97" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a93" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.json index 002ae923e10..62ebf944c96 100644 --- a/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Unarchive_case_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a8e" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a91" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.json index 7f4eb713cd3..cecc822b03b 100644 --- a/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Unassign_case_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a99" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a8e" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.json index f385c73dcf2..b14660ec9cf 100644 --- a/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Unassign_case_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a95" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a99" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_App_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_App_returns_Bad_Request_response.json index 2b6d04719f1..a7ae1c7d92b 100644 --- a/src/test/resources/cassettes/features/v2/Update_App_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_App_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "820bad24-1ae4-7d45-b443-7591eb8052bf" + "id": "820bad24-1ae4-7d45-b443-7591eb8052c0" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_App_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_App_returns_OK_response.json index bbc137c73b9..f710ccfca84 100644 --- a/src/test/resources/cassettes/features/v2/Update_App_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_App_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "820bad24-1ae4-7d45-b443-7591eb8052c2" + "id": "820bad24-1ae4-7d45-b443-7591eb8052c3" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json index b5b37b15e5f..7023629b791 100644 --- a/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_Scanning_Group_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e81" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7f" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15f" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15d" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json index d75053c9fd1..b45ec732f85 100644 --- a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_Bad_Request_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e78" + "id": "01611a93-5e74-0630-3c51-f707c3b51e80" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed158" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15e" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json index f1aa2480d43..fc5d23f9112 100644 --- a/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_Scanning_Rule_returns_OK_response.json @@ -23,7 +23,7 @@ "timeToLive": { "unlimited": true }, - "id": "01611a93-5e74-0630-3c51-f707c3b51e7b" + "id": "01611a93-5e74-0630-3c51-f707c3b51e7e" }, { "httpRequest": { @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15b" + "id": "33fa4a39-57ef-afdd-007a-0db82f7ed15c" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..a27df8153f5 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:44.191Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..816f84d0c48 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Bad_Request_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"enabled\":true,\"name\":\"Test-Update_a_mute_rule_returns_Bad_Request_response-1737639704\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"d54c43cb-1ff0-4f60-a3cc-2794815252a8\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639704499,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639704499,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_a_mute_rule_returns_Bad_Request_response-1737639704\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9b06b368-5bc6-86c1-7a1a-dcbfcfc590d4" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"invalid\":{\"attributes\":{\"action\":{\"expire_at\":1893452400000,\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"d54c43cb-1ff0-4f60-a3cc-2794815252a8\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/d54c43cb-1ff0-4f60-a3cc-2794815252a8", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"Error while unmarshalling JSON API request\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6a3e628f-6a03-8da0-1369-04ad60efa601" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/d54c43cb-1ff0-4f60-a3cc-2794815252a8", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cc68a1da-9d22-6840-8d81-9a545f9fb303" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Mute_rule_successfully_updated_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Mute_rule_successfully_updated_response.freeze new file mode 100644 index 00000000000..83b8f33ec65 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Mute_rule_successfully_updated_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:45.445Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Mute_rule_successfully_updated_response.json b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Mute_rule_successfully_updated_response.json new file mode 100644 index 00000000000..b916cd31f33 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Mute_rule_successfully_updated_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"enabled\":true,\"name\":\"Test-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1737639705\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"fa5829ab-aee5-458e-abc7-86b8f0a4687f\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639705754,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639705754,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1737639705\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4b326563-c1e8-7ebd-da4a-69444b5c6171" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"expire_at\":1893452400000,\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"fa5829ab-aee5-458e-abc7-86b8f0a4687f\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/fa5829ab-aee5-458e-abc7-86b8f0a4687f", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"fa5829ab-aee5-458e-abc7-86b8f0a4687f\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\",\"expire_at\":1893452400000},\"created_at\":1737639705754,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639706208,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "527cb773-31fe-bf91-a02e-90c61ae7026a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/fa5829ab-aee5-458e-abc7-86b8f0a4687f", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0ef89075-ebd8-3fa1-4734-1a96eee952ef" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..76217e7065c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:46.701Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Not_Found_response.json new file mode 100644 index 00000000000..eef2a16d582 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"expire_at\":1893452400000,\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"00000000-0000-0000-0000-426655000000\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ac16fb17-71ae-0809-00c3-8b63c5e69d92" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze new file mode 100644 index 00000000000..3e138c549d6 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze @@ -0,0 +1 @@ +2025-01-23T13:41:47.047Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json new file mode 100644 index 00000000000..0becc875a37 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"enabled\":true,\"name\":\"Test-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1737639707\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"0582999c-857d-4be3-8aeb-5f70920f04fe\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1737639707463,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737639707463,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1737639707\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9c36a170-0d3e-a031-a8ed-be624c4504fe" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"expire_at\":1893452400000,\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"00000000-0000-0000-0000-426655000000\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/0582999c-857d-4be3-8aeb-5f70920f04fe", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"422\",\"title\":\"Unprocessable Entity\",\"detail\":\"Rule Ids in path and in request body differ\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 422, + "reasonPhrase": "Unprocessable Entity" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "18f3ea55-8d91-d640-2739-47f25871504b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/0582999c-857d-4be3-8aeb-5f70920f04fe", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0bc0683b-a7c3-f6cf-33b9-35d34c49a9f3" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Bad_Request_response.json index 9e28b4f6ae0..b7374ea7691 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_retention_filter_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069a" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069c" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Bad_Request_response.json index 87c7ca222ab..a8ee0769782 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff069c" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0699" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_OK_response.json index ab8e3e5c76a..4f6a89b85f3 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_retention_filters_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0699" + "id": "b2404278-8cc9-cba4-e3eb-03a7fdff0697" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Request_response.json index 73305cd59ef..7974cef2f13 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Request_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892171" + "id": "ab2c08c1-60c7-9278-3246-d650bb89216d" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json index 48fbe0112ca..5a7b5785430 100644 --- a/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json +++ b/src/test/resources/cassettes/features/v2/Update_a_role_returns_Bad_Role_ID_response.json @@ -53,7 +53,7 @@ "timeToLive": { "unlimited": true }, - "id": "ab2c08c1-60c7-9278-3246-d650bb892172" + "id": "ab2c08c1-60c7-9278-3246-d650bb892171" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json index faa09ac1659..d1b1c3df533 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_AWS_Account_object_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "cd59362c-7df2-d349-9880-5b5536151a0b" + "id": "cd59362c-7df2-d349-9880-5b5536151a07" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json index 085e26e219b..bdfd453a4ac 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_an_AWS_integration_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "cd59362c-7df2-d349-9880-5b5536151a07" + "id": "cd59362c-7df2-d349-9880-5b5536151a0a" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..32293142506 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:41:21.299Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Bad_Request_response.json new file mode 100644 index 00000000000..641e7b1e112 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Bad_Request_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"enabled\":true,\"name\":\"Test-Update_an_inbox_rule_returns_Bad_Request_response-1737621681\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"ebe5f9b6-a0fe-4422-9909-2116aa9cb057\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621681706,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621681706,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_an_inbox_rule_returns_Bad_Request_response-1737621681\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d1abe4c0-cabf-414b-50dd-045a1dc79e34" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"invalid\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"ebe5f9b6-a0fe-4422-9909-2116aa9cb057\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/ebe5f9b6-a0fe-4422-9909-2116aa9cb057", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"Error while unmarshalling JSON API request\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "10eee6f8-3576-34ec-5fea-be6b81d4e78b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/ebe5f9b6-a0fe-4422-9909-2116aa9cb057", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "88f93961-ab19-2db6-ac05-098a2dff539f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response.freeze new file mode 100644 index 00000000000..564f1128075 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:41:22.606Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response.json b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response.json new file mode 100644 index 00000000000..5ffb10b47c3 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"enabled\":true,\"name\":\"Test-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1737621682\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"1cc830c9-b1ea-4a80-bc54-db42bb0ac198\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621683029,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621683029,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1737621682\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "80d1d73a-29e1-77c7-cd3b-e7a3a9273ddc" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"1cc830c9-b1ea-4a80-bc54-db42bb0ac198\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/1cc830c9-b1ea-4a80-bc54-db42bb0ac198", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"1cc830c9-b1ea-4a80-bc54-db42bb0ac198\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1737621683029,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621683396,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"application_code_vulnerability\"],\"rule_ids\":[\"rule-id-1\"],\"query\":\"key:val\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ef84b3af-3f78-2020-a714-77fae2e42ddb" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/1cc830c9-b1ea-4a80-bc54-db42bb0ac198", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e2ae87fe-feb6-15d0-9be1-564f7447186d" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..9f7cf1e2163 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:41:23.940Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Not_Found_response.json new file mode 100644 index 00000000000..02d41fcd1c9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Not_Found_response.json @@ -0,0 +1,32 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"00000000-0000-0000-0000-426655000000\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"404\",\"title\":\"Not Found\",\"detail\":\"Rule does not exist\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dafc2706-5a56-ec0f-6590-f235f016ffef" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze new file mode 100644 index 00000000000..09f4343019c --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.freeze @@ -0,0 +1 @@ +2025-01-23T08:41:24.430Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json new file mode 100644 index 00000000000..f8c0a93a885 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"enabled\":true,\"name\":\"Test-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1737621684\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"\",\"rule_ids\":[],\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"severities\":[\"critical\"]}},\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"a7b01380-2a2f-4664-8ac4-912d14791749\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1737621684732,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1737621684732,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1737621684\",\"rule\":{\"issue_type\":\"vulnerability\",\"rule_types\":[\"misconfiguration\",\"attack_path\"],\"rule_ids\":[],\"query\":\"\",\"severities\":[\"critical\"]}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "73600dad-2e7a-e683-504f-914d5ea88092" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"enabled\":true,\"name\":\"Rule 1\",\"rule\":{\"issue_type\":\"vulnerability\",\"query\":\"key:val\",\"rule_ids\":[\"rule-id-1\"],\"rule_types\":[\"application_code_vulnerability\"],\"severities\":[\"critical\"]}},\"id\":\"00000000-0000-0000-0000-426655000000\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/a7b01380-2a2f-4664-8ac4-912d14791749", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"status\":\"422\",\"title\":\"Unprocessable Entity\",\"detail\":\"Rule Ids in path and in request body differ\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 422, + "reasonPhrase": "Unprocessable Entity" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a20e4cf8-0b4c-7624-724d-6a409d3bdd4b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/a7b01380-2a2f-4664-8ac4-912d14791749", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "82270af4-e4a5-cc4e-5f28-1ce16edb37fc" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_an_incident_type_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_an_incident_type_returns_OK_response.json index c88b7d95168..9c252eb38fd 100644 --- a/src/test/resources/cassettes/features/v2/Update_an_incident_type_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_an_incident_type_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd1" + "id": "7bcfec66-5300-9891-51e5-e4d7e0833bd3" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.json index eec119b3808..820d5e08dd0 100644 --- a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a93" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a90" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.json index 0aad124e6e6..678d14c3416 100644 --- a/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_case_priority_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a8d" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a96" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.json index 1b5b3d7addc..3ccc782c10d 100644 --- a/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.json +++ b/src/test/resources/cassettes/features/v2/Update_case_status_returns_Bad_Request_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a90" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a92" }, { "httpRequest": { diff --git a/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.json index 06ef9ebc0be..72621cd0a77 100644 --- a/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.json +++ b/src/test/resources/cassettes/features/v2/Update_case_status_returns_OK_response.json @@ -27,7 +27,7 @@ "timeToLive": { "unlimited": true }, - "id": "0a6534d0-42f2-5075-64f8-7ab28f449a96" + "id": "0a6534d0-42f2-5075-64f8-7ab28f449a94" }, { "httpRequest": { diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index e5c2cbcc488..fcafe2e1ff2 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/given.json +++ b/src/test/resources/com/datadog/api/client/v2/api/given.json @@ -547,6 +547,30 @@ "tag": "Service Scorecards", "operationId": "CreateScorecardRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"inbox_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"rule\": {\n \"issue_type\": \"vulnerability\",\n \"rule_types\": [\"misconfiguration\", \"attack_path\"],\n \"rule_ids\": [],\n \"severities\": [\"critical\"],\n \"query\": \"\"\n },\n \"action\": {\n \"reason_description\": \"items to focus on\"\n },\n \"enabled\": true\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_inbox_rule\" in the system", + "key": "valid_inbox_rule", + "tag": "Security Monitoring", + "operationId": "CreateInboxRule" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"mute_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"rule\": {\n \"issue_type\": \"vulnerability\",\n \"rule_types\": [\"misconfiguration\", \"attack_path\"],\n \"rule_ids\": [],\n \"severities\": [\"critical\"],\n \"query\": \"\"\n },\n \"action\": {\n \"reason\": \"duplicate\"\n },\n \"enabled\": true\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_mute_rule\" in the system", + "key": "valid_mute_rule", + "tag": "Security Monitoring", + "operationId": "CreateMuteRule" + }, { "parameters": [ { diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index 5a2330a8f35..58bb35e15d1 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -235,6 +235,34 @@ Feature: Security Monitoring And the response "message" is equal to "Test rule" And the response "isEnabled" is equal to true + @team:DataDog/cloud-security-posture-management + Scenario: Create a new inbox rule returns "Bad Request" response + Given new "CreateInboxRule" request + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Create a new inbox rule returns "Successfully created the inbox rule" response + Given new "CreateInboxRule" request + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "type": "inbox_rules"}} + When the request is sent + Then the response status is 201 Successfully created the inbox rule + + @team:DataDog/cloud-security-posture-management + Scenario: Create a new mute rule returns "Bad Request" response + Given new "CreateMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Create a new mute rule returns "Successfully created the mute rule" response + Given new "CreateMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 201 Successfully created the mute rule + @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a security filter returns "Bad Request" response Given new "CreateSecurityFilter" request @@ -296,6 +324,21 @@ 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/cloud-security-posture-management + Scenario: Delete a mute rule returns "Not Found" response + Given new "DeleteMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Delete a mute rule returns "Rule successfully deleted" response + Given there is a valid "valid_mute_rule" in the system + And new "DeleteMuteRule" request + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted + @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a non existing rule returns "Not Found" response Given new "DeleteSecurityMonitoringRule" request @@ -328,7 +371,7 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a suppression rule returns "Not Found" response Given new "DeleteSecurityMonitoringSuppression" request - And request contains "suppression_id" parameter with value "does-not-exist" + And request contains "suppression_id" parameter with value "00000000-0000-0000-0000-426655000000" When the request is sent Then the response status is 404 Not Found @@ -387,6 +430,21 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @team:DataDog/cloud-security-posture-management + Scenario: Delete an inbox rule returns "Not Found" response + Given new "DeleteInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Delete an inbox rule returns "Rule successfully deleted" response + Given there is a valid "valid_inbox_rule" in the system + And new "DeleteInboxRule" request + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted + @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 @@ -599,6 +657,64 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Bad Request" response + Given new "GetMuteRule" request + And request contains "mute_rule_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Mute rule details" response + Given new "GetMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 200 Mute rule details + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Not Found" response + Given new "GetMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Bad Request" response + Given new "GetInboxRule" request + And request contains "inbox_rule_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Inbox rule details" response + Given new "GetInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + When the request is sent + Then the response status is 200 Inbox rule details + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Not Found" response + Given new "GetInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Get the ordered list of inbox rules returns "The list of inbox rules" response + Given new "GetInboxRules" request + And there is a valid "valid_inbox_rule" in the system + When the request is sent + Then the response status is 200 The list of inbox rules + + @team:DataDog/cloud-security-posture-management + Scenario: Get the ordered list of mute rules returns "The list of mute rules" response + Given new "GetMuteRules" request + And there is a valid "valid_mute_rule" in the system + When the request is sent + Then the response status is 200 The list of mute rules + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: List findings returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListFindings" enabled @@ -773,6 +889,104 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @skip @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "Bad Request" response + Given new "PatchMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "Mute rule successfully patched" response + Given new "PatchMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 200 Mute rule successfully patched + + @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "Not Found" response + Given new "PatchMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "The server cannot process the request because it contains invalid data." response + Given new "PatchMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "Bad Request" response + Given new "PatchInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "Inbox rule successfully patched" response + Given new "PatchInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 200 Inbox rule successfully patched + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "Not Found" response + Given new "PatchInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "The server cannot process the request because it contains invalid data." response + Given new "PatchInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of inbox rules in the pipeline returns "Bad Request" response + Given new "ReorderInboxRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "inbox_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of inbox rules in the pipeline returns "The list of inbox rules" response + Given new "ReorderInboxRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "inbox_rules"}]} + When the request is sent + Then the response status is 200 The list of inbox rules + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of mute rules in the pipeline returns "Bad Request" response + Given new "ReorderMuteRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of mute rules in the pipeline returns "The list of mute rules" response + Given new "ReorderMuteRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 200 The list of mute rules + @team:DataDog/k9-cloud-security-platform Scenario: Run a historical job returns "Bad Request" response Given operation "RunHistoricalJob" enabled @@ -854,6 +1068,41 @@ Feature: Security Monitoring And the response "name" is equal to "{{ unique }}_cloud_updated" And the response "id" has the same value as "cloud_configuration_rule.id" + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "Bad Request" response + Given new "UpdateMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "Mute rule successfully updated" response + Given new "UpdateMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 200 Mute rule successfully updated + + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "Not Found" response + Given new "UpdateMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "The server cannot process the request because it contains invalid data." response + Given new "UpdateMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a security filter returns "Bad Request" response Given new "UpdateSecurityFilter" request @@ -954,6 +1203,41 @@ Feature: Security Monitoring And the response "name" is equal to "{{ unique }}-Updated" And the response "id" has the same value as "security_rule.id" + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "Bad Request" response + Given new "UpdateInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "Inbox rule successfully updated" response + Given new "UpdateInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 200 Inbox rule successfully updated + + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "Not Found" response + Given new "UpdateInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "The server cannot process the request because it contains invalid data." response + Given new "UpdateInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-typescript @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Validate a detection rule returns "Bad Request" response Given new "ValidateSecurityMonitoringRule" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index a195ddc9e5e..76ae165eb6b 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -2073,6 +2073,104 @@ "type": "safe" } }, + "GetInboxRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateInboxRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteInboxRule", + "parameters": [ + { + "name": "inbox_rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderInboxRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "PatchInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "UpdateInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateMuteRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteMuteRule", + "parameters": [ + { + "name": "mute_rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "PatchMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "UpdateMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListCloudWorkloadSecurityAgentRules": { "tag": "CSM Threats", "undo": {