diff --git a/.apigentools-info b/.apigentools-info index 8d14e063f8e..6b31e54999a 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-28 14:57:27.800529", - "spec_repo_commit": "f832f43e" + "regenerated": "2025-01-28 16:23:35.118971", + "spec_repo_commit": "590dadb7" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-28 14:57:27.815886", - "spec_repo_commit": "f832f43e" + "regenerated": "2025-01-28 16:23:35.134139", + "spec_repo_commit": "590dadb7" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ec0661fe202..28344b419e9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -733,6 +733,13 @@ components: type: string requestBodies: {} responses: + AutomationRuleUnprocessableEntityResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: The server cannot process the request because it contains invalid + data. BadRequestResponse: content: application/json: @@ -782,6 +789,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: @@ -1748,6 +1777,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: @@ -2757,6 +2811,49 @@ components: type: string x-enum-varnames: - AUTHN_MAPPINGS + AutomationRule: + 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/SecurityRuleTypes' + severities: + description: The security rules severities to consider + items: + $ref: '#/components/schemas/SecurityRuleSeverity' + type: array + required: + - issue_type + - rule_types + type: object + AutomationRuleName: + description: Name of the pipeline rule + example: Rule 1 + type: string + AutomationRuleUser: + 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 AwsCURConfig: description: AWS CUR config. properties: @@ -7451,6 +7548,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/RuleEnabled' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + 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/RuleEnabled' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + required: + - action + - name + - rule + type: object CreateNotificationRuleParameters: description: Body of the notification rule create request. properties: @@ -13271,6 +13438,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/RuleModificationDate' + created_by: + $ref: '#/components/schemas/AutomationRuleUser' + enabled: + $ref: '#/components/schemas/RuleEnabled' + modified_at: + $ref: '#/components/schemas/RuleModificationDate' + modified_by: + $ref: '#/components/schemas/AutomationRuleUser' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + 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: @@ -15405,6 +15633,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: @@ -19255,6 +19491,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/RuleModificationDate' + created_by: + $ref: '#/components/schemas/AutomationRuleUser' + enabled: + $ref: '#/components/schemas/RuleEnabled' + modified_at: + $ref: '#/components/schemas/RuleModificationDate' + modified_by: + $ref: '#/components/schemas/AutomationRuleUser' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + 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 NotificationRule: description: 'Notification rules allow full control over notifications generated by the various Datadog security products. @@ -20186,6 +20507,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/RuleEnabled' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + 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/RuleEnabled' + name: + $ref: '#/components/schemas/AutomationRuleName' + rule: + $ref: '#/components/schemas/AutomationRule' + type: object PatchNotificationRuleParameters: description: Body of the notification rule patch request. properties: @@ -22227,6 +22616,50 @@ components: - new_advisories - avoided_advisories type: object + ReorderInboxRulesParameters: + description: 'Body of the inbox rule reorder request: the full list of inbox + rules, which must 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, + which must 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: @@ -22911,10 +23344,26 @@ components: example: Deployments automated via Deployment Trains type: string type: object + RuleEnabled: + description: Field used to enable or disable the rule. + example: true + type: boolean RuleId: 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 + RuleModificationDate: + description: Date as Unix timestamp in milliseconds + example: 1722439510282 + format: int64 + type: integer RuleName: description: Name of the notification rule. example: Rule 1 @@ -22925,6 +23374,11 @@ components: 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: @@ -25894,6 +26348,52 @@ components: nullable: true type: string type: object + SecurityRuleSeverity: + 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 + SecurityRuleTypes: + description: Security rule types + example: + - application_code_vulnerability + items: + $ref: '#/components/schemas/SecurityRuleTypesItems' + type: array + SecurityRuleTypesItems: + 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 Selectors: description: 'Selectors are used to filter security issues for which notifications should be generated. @@ -29421,6 +29921,11 @@ components: x-enum-varnames: - SECURITY_FINDINGS - SECURITY_SIGNALS + 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. @@ -29641,6 +30146,48 @@ components: type: string type: array 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: @@ -44442,6 +44989,559 @@ paths: operator: OR permissions: - security_monitoring_notification_profiles_write + /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 must 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 becomes 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 is not 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/AutomationRuleUnprocessableEntityResponse' + '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 is 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/AutomationRuleUnprocessableEntityResponse' + '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 must 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 becomes 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 is not 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/AutomationRuleUnprocessableEntityResponse' + '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 is 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/AutomationRuleUnprocessableEntityResponse' + '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..58024a8a4d5 --- /dev/null +++ b/examples/v2/security-monitoring/CreateInboxRule.java @@ -0,0 +1,57 @@ +// 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.AutomationRule; +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.SecurityRuleSeverity; +import com.datadog.api.client.v2.model.SecurityRuleTypesItems; +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 AutomationRule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities( + Collections.singletonList(SecurityRuleSeverity.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..d42b426a6b0 --- /dev/null +++ b/examples/v2/security-monitoring/CreateMuteRule.java @@ -0,0 +1,60 @@ +// 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.AutomationRule; +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.SecurityRuleSeverity; +import com.datadog.api.client.v2.model.SecurityRuleTypesItems; +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 AutomationRule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities( + Collections.singletonList(SecurityRuleSeverity.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..b51e21551ce --- /dev/null +++ b/examples/v2/security-monitoring/PatchInboxRule.java @@ -0,0 +1,67 @@ +// 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.AutomationRule; +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.SecurityRuleSeverity; +import com.datadog.api.client.v2.model.SecurityRuleTypesItems; +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 AutomationRule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities( + Collections.singletonList(SecurityRuleSeverity.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..bc759e6a7fe --- /dev/null +++ b/examples/v2/security-monitoring/PatchMuteRule.java @@ -0,0 +1,70 @@ +// 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.AutomationRule; +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.SecurityRuleSeverity; +import com.datadog.api.client.v2.model.SecurityRuleTypesItems; +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 AutomationRule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities( + Collections.singletonList(SecurityRuleSeverity.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..9431c041c31 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateInboxRule.java @@ -0,0 +1,67 @@ +// 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.AutomationRule; +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.SecurityRuleSeverity; +import com.datadog.api.client.v2.model.SecurityRuleTypesItems; +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 AutomationRule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities( + Collections.singletonList(SecurityRuleSeverity.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..1ff1df22ec1 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateMuteRule.java @@ -0,0 +1,70 @@ +// 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.AutomationRule; +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.SecurityRuleSeverity; +import com.datadog.api.client.v2.model.SecurityRuleTypesItems; +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 AutomationRule() + .issueType(IssueType.VULNERABILITY) + .query("key:val") + .ruleIds(Collections.singletonList("rule-id-1")) + .ruleTypes( + Collections.singletonList( + SecurityRuleTypesItems.APPLICATION_CODE_VULNERABILITY)) + .severities( + Collections.singletonList(SecurityRuleSeverity.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 c43bcd11457..fad57699954 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.CreateNotificationRuleParameters; import com.datadog.api.client.v2.model.Finding; import com.datadog.api.client.v2.model.FindingEvaluation; @@ -17,13 +19,19 @@ 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.NotificationRuleResponse; +import com.datadog.api.client.v2.model.PatchInboxRulesParameters; +import com.datadog.api.client.v2.model.PatchMuteRuleParameters; import com.datadog.api.client.v2.model.PatchNotificationRuleParameters; +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; @@ -52,6 +60,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; @@ -65,6 +75,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( @@ -690,6 +701,300 @@ public SecurityMonitoringRuleConvertResponse convertSecurityMonitoringRuleFromJS new GenericType<SecurityMonitoringRuleConvertResponse>() {}); } + /** + * Create a new inbox rule. + * + * <p>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. + * + * <p>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<InboxRuleResponse> 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 + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 201 </td><td> Successfully created the inbox rule </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<InboxRuleResponse> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createInboxRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<InboxRuleResponse>() {}); + } + + /** + * Create a new inbox rule. + * + * <p>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<ApiResponse<InboxRuleResponse>> createInboxRuleWithHttpInfoAsync( + CreateInboxRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture<ApiResponse<InboxRuleResponse>> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createInboxRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<InboxRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<InboxRuleResponse>() {}); + } + + /** + * Create a new mute rule. + * + * <p>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. + * + * <p>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<MuteRuleResponse> 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 + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 201 </td><td> Successfully created the mute rule </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<MuteRuleResponse> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createMuteRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<MuteRuleResponse>() {}); + } + + /** + * Create a new mute rule. + * + * <p>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<ApiResponse<MuteRuleResponse>> createMuteRuleWithHttpInfoAsync( + CreateMuteRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture<ApiResponse<MuteRuleResponse>> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.createMuteRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<MuteRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<MuteRuleResponse>() {}); + } + /** * Create a security filter. * @@ -1544,27 +1849,27 @@ public CompletableFuture<ApiResponse<Void>> deleteHistoricalJobWithHttpInfoAsync } /** - * Delete a security filter. + * Delete an inbox rule. * - * <p>See {@link #deleteSecurityFilterWithHttpInfo}. + * <p>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. * - * <p>See {@link #deleteSecurityFilterWithHttpInfoAsync}. + * <p>See {@link #deleteInboxRuleWithHttpInfoAsync}. * - * @param securityFilterId The ID of the security filter. (required) + * @param inboxRuleId ID of the inbox rule (required) * @return CompletableFuture */ - public CompletableFuture<Void> deleteSecurityFilterAsync(String securityFilterId) { - return deleteSecurityFilterWithHttpInfoAsync(securityFilterId) + public CompletableFuture<Void> deleteInboxRuleAsync(UUID inboxRuleId) { + return deleteInboxRuleWithHttpInfoAsync(inboxRuleId) .thenApply( response -> { return response.getData(); @@ -1572,43 +1877,40 @@ public CompletableFuture<Void> 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 * <table border="1"> * <caption>Response details</caption> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> - * <tr><td> 204 </td><td> OK </td><td> - </td></tr> - * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> + * <tr><td> 204 </td><td> Rule successfully deleted </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> * </table> */ - public ApiResponse<Void> deleteSecurityFilterWithHttpInfo(String securityFilterId) - throws ApiException { + public ApiResponse<Void> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityFilter", + "v2.SecurityMonitoringApi.deleteInboxRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -1627,33 +1929,29 @@ public ApiResponse<Void> deleteSecurityFilterWithHttpInfo(String securityFilterI } /** - * Delete a security filter. + * Delete an inbox rule. * - * <p>See {@link #deleteSecurityFilterWithHttpInfo}. + * <p>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<ApiResponse<Void>> deleteSecurityFilterWithHttpInfoAsync( - String securityFilterId) { + public CompletableFuture<ApiResponse<Void>> 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<ApiResponse<Void>> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -1661,7 +1959,7 @@ public CompletableFuture<ApiResponse<Void>> deleteSecurityFilterWithHttpInfoAsyn try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityFilter", + "v2.SecurityMonitoringApi.deleteInboxRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -1685,27 +1983,27 @@ public CompletableFuture<ApiResponse<Void>> deleteSecurityFilterWithHttpInfoAsyn } /** - * Delete an existing rule. + * Delete a mute rule. * - * <p>See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. + * <p>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. * - * <p>See {@link #deleteSecurityMonitoringRuleWithHttpInfoAsync}. + * <p>See {@link #deleteMuteRuleWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) + * @param muteRuleId ID of the mute rule (required) * @return CompletableFuture */ - public CompletableFuture<Void> deleteSecurityMonitoringRuleAsync(String ruleId) { - return deleteSecurityMonitoringRuleWithHttpInfoAsync(ruleId) + public CompletableFuture<Void> deleteMuteRuleAsync(UUID muteRuleId) { + return deleteMuteRuleWithHttpInfoAsync(muteRuleId) .thenApply( response -> { return response.getData(); @@ -1713,40 +2011,40 @@ public CompletableFuture<Void> 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 * <table border="1"> * <caption>Response details</caption> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> - * <tr><td> 204 </td><td> OK </td><td> - </td></tr> - * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> + * <tr><td> 204 </td><td> Rule successfully deleted </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> * </table> */ - public ApiResponse<Void> deleteSecurityMonitoringRuleWithHttpInfo(String ruleId) - throws ApiException { + public ApiResponse<Void> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", + "v2.SecurityMonitoringApi.deleteMuteRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -1765,30 +2063,29 @@ public ApiResponse<Void> deleteSecurityMonitoringRuleWithHttpInfo(String ruleId) } /** - * Delete an existing rule. + * Delete a mute rule. * - * <p>See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. + * <p>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<ApiResponse<Void>> deleteSecurityMonitoringRuleWithHttpInfoAsync( - String ruleId) { + public CompletableFuture<ApiResponse<Void>> 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<ApiResponse<Void>> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -1796,7 +2093,7 @@ public CompletableFuture<ApiResponse<Void>> deleteSecurityMonitoringRuleWithHttp try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", + "v2.SecurityMonitoringApi.deleteMuteRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -1820,27 +2117,27 @@ public CompletableFuture<ApiResponse<Void>> deleteSecurityMonitoringRuleWithHttp } /** - * Delete a suppression rule. + * Delete a security filter. * - * <p>See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. + * <p>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. * - * <p>See {@link #deleteSecurityMonitoringSuppressionWithHttpInfoAsync}. + * <p>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<Void> deleteSecurityMonitoringSuppressionAsync(String suppressionId) { - return deleteSecurityMonitoringSuppressionWithHttpInfoAsync(suppressionId) + public CompletableFuture<Void> deleteSecurityFilterAsync(String securityFilterId) { + return deleteSecurityFilterWithHttpInfoAsync(securityFilterId) .thenApply( response -> { return response.getData(); @@ -1848,9 +2145,9 @@ public CompletableFuture<Void> 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 @@ -1863,28 +2160,28 @@ public CompletableFuture<Void> deleteSecurityMonitoringSuppressionAsync(String s * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> * </table> */ - public ApiResponse<Void> deleteSecurityMonitoringSuppressionWithHttpInfo(String suppressionId) + public ApiResponse<Void> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.deleteSecurityFilter", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -1903,32 +2200,33 @@ public ApiResponse<Void> deleteSecurityMonitoringSuppressionWithHttpInfo(String } /** - * Delete a suppression rule. + * Delete a security filter. * - * <p>See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. + * <p>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<ApiResponse<Void>> deleteSecurityMonitoringSuppressionWithHttpInfoAsync( - String suppressionId) { + public CompletableFuture<ApiResponse<Void>> 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<ApiResponse<Void>> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -1936,7 +2234,7 @@ public CompletableFuture<ApiResponse<Void>> deleteSecurityMonitoringSuppressionW try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.deleteSecurityFilter", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -1960,27 +2258,27 @@ public CompletableFuture<ApiResponse<Void>> deleteSecurityMonitoringSuppressionW } /** - * Delete a signal-based rule. + * Delete an existing rule. * - * <p>See {@link #deleteSignalNotificationRuleWithHttpInfo}. + * <p>See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param ruleId The ID of the rule. (required) * @throws ApiException if fails to make API call */ - public void deleteSignalNotificationRule(String id) throws ApiException { - deleteSignalNotificationRuleWithHttpInfo(id); + public void deleteSecurityMonitoringRule(String ruleId) throws ApiException { + deleteSecurityMonitoringRuleWithHttpInfo(ruleId); } /** - * Delete a signal-based rule. + * Delete an existing rule. * - * <p>See {@link #deleteSignalNotificationRuleWithHttpInfoAsync}. + * <p>See {@link #deleteSecurityMonitoringRuleWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param ruleId The ID of the rule. (required) * @return CompletableFuture */ - public CompletableFuture<Void> deleteSignalNotificationRuleAsync(String id) { - return deleteSignalNotificationRuleWithHttpInfoAsync(id) + public CompletableFuture<Void> deleteSecurityMonitoringRuleAsync(String ruleId) { + return deleteSecurityMonitoringRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -1988,39 +2286,40 @@ public CompletableFuture<Void> deleteSignalNotificationRuleAsync(String id) { } /** - * Delete a notification rule for security signals. + * Delete an existing rule. Default rules cannot be deleted. * - * @param id ID of the notification rule. (required) + * @param ruleId The ID of the rule. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * <table border="1"> * <caption>Response details</caption> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> - * <tr><td> 204 </td><td> Rule successfully deleted. </td><td> - </td></tr> - * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 204 </td><td> OK </td><td> - </td></tr> + * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> * </table> */ - public ApiResponse<Void> deleteSignalNotificationRuleWithHttpInfo(String id) throws ApiException { + public ApiResponse<Void> deleteSecurityMonitoringRuleWithHttpInfo(String ruleId) + throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( - 400, "Missing the required parameter 'id' when calling deleteSignalNotificationRule"); + 400, "Missing the required parameter 'ruleId' when calling deleteSecurityMonitoringRule"); } // create path and map variables String localVarPath = - "/api/v2/security/signals/notification_rules/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + "/api/v2/security_monitoring/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSignalNotificationRule", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -2039,30 +2338,30 @@ public ApiResponse<Void> deleteSignalNotificationRuleWithHttpInfo(String id) thr } /** - * Delete a signal-based rule. + * Delete an existing rule. * - * <p>See {@link #deleteSignalNotificationRuleWithHttpInfo}. + * <p>See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param ruleId The ID of the rule. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture<ApiResponse<Void>> deleteSignalNotificationRuleWithHttpInfoAsync( - String id) { + public CompletableFuture<ApiResponse<Void>> deleteSecurityMonitoringRuleWithHttpInfoAsync( + String ruleId) { Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'id' when calling deleteSignalNotificationRule")); + "Missing the required parameter 'ruleId' when calling deleteSecurityMonitoringRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security/signals/notification_rules/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + "/api/v2/security_monitoring/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -2070,7 +2369,7 @@ public CompletableFuture<ApiResponse<Void>> deleteSignalNotificationRuleWithHttp try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSignalNotificationRule", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -2094,27 +2393,27 @@ public CompletableFuture<ApiResponse<Void>> deleteSignalNotificationRuleWithHttp } /** - * Delete a vulnerability-based rule. + * Delete a suppression rule. * - * <p>See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. + * <p>See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param suppressionId The ID of the suppression rule (required) * @throws ApiException if fails to make API call */ - public void deleteVulnerabilityNotificationRule(String id) throws ApiException { - deleteVulnerabilityNotificationRuleWithHttpInfo(id); + public void deleteSecurityMonitoringSuppression(String suppressionId) throws ApiException { + deleteSecurityMonitoringSuppressionWithHttpInfo(suppressionId); } /** - * Delete a vulnerability-based rule. + * Delete a suppression rule. * - * <p>See {@link #deleteVulnerabilityNotificationRuleWithHttpInfoAsync}. + * <p>See {@link #deleteSecurityMonitoringSuppressionWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param suppressionId The ID of the suppression rule (required) * @return CompletableFuture */ - public CompletableFuture<Void> deleteVulnerabilityNotificationRuleAsync(String id) { - return deleteVulnerabilityNotificationRuleWithHttpInfoAsync(id) + public CompletableFuture<Void> deleteSecurityMonitoringSuppressionAsync(String suppressionId) { + return deleteSecurityMonitoringSuppressionWithHttpInfoAsync(suppressionId) .thenApply( response -> { return response.getData(); @@ -2122,41 +2421,43 @@ public CompletableFuture<Void> deleteVulnerabilityNotificationRuleAsync(String i } /** - * Delete a notification rule for security vulnerabilities. + * Delete a specific suppression rule. * - * @param id ID of the notification rule. (required) + * @param suppressionId The ID of the suppression rule (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * <table border="1"> * <caption>Response details</caption> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> - * <tr><td> 204 </td><td> Rule successfully deleted. </td><td> - </td></tr> - * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 204 </td><td> OK </td><td> - </td></tr> + * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> * </table> */ - public ApiResponse<Void> deleteVulnerabilityNotificationRuleWithHttpInfo(String id) + public ApiResponse<Void> deleteSecurityMonitoringSuppressionWithHttpInfo(String suppressionId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { throw new ApiException( 400, - "Missing the required parameter 'id' when calling deleteVulnerabilityNotificationRule"); + "Missing the required parameter 'suppressionId' when calling" + + " deleteSecurityMonitoringSuppression"); } // create path and map variables String localVarPath = - "/api/v2/security/vulnerabilities/notification_rules/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -2175,31 +2476,32 @@ public ApiResponse<Void> deleteVulnerabilityNotificationRuleWithHttpInfo(String } /** - * Delete a vulnerability-based rule. + * Delete a suppression rule. * - * <p>See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. + * <p>See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param suppressionId The ID of the suppression rule (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture<ApiResponse<Void>> deleteVulnerabilityNotificationRuleWithHttpInfoAsync( - String id) { + public CompletableFuture<ApiResponse<Void>> deleteSecurityMonitoringSuppressionWithHttpInfoAsync( + String suppressionId) { Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'id' when calling" - + " deleteVulnerabilityNotificationRule")); + "Missing the required parameter 'suppressionId' when calling" + + " deleteSecurityMonitoringSuppression")); return result; } // create path and map variables String localVarPath = - "/api/v2/security/vulnerabilities/notification_rules/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -2207,7 +2509,7 @@ public CompletableFuture<ApiResponse<Void>> deleteVulnerabilityNotificationRuleW try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -2231,33 +2533,27 @@ public CompletableFuture<ApiResponse<Void>> deleteVulnerabilityNotificationRuleW } /** - * Modify the triage assignee of a security signal. + * Delete a signal-based rule. * - * <p>See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. + * <p>See {@link #deleteSignalNotificationRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return SecurityMonitoringSignalTriageUpdateResponse + * @param id ID of the notification 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 deleteSignalNotificationRule(String id) throws ApiException { + deleteSignalNotificationRuleWithHttpInfo(id); } /** - * Modify the triage assignee of a security signal. + * Delete a signal-based rule. * - * <p>See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfoAsync}. + * <p>See {@link #deleteSignalNotificationRuleWithHttpInfoAsync}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + * @param id ID of the notification rule. (required) + * @return CompletableFuture */ - public CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> - editSecurityMonitoringSignalAssigneeAsync( - String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { - return editSecurityMonitoringSignalAssigneeWithHttpInfoAsync(signalId, body) + public CompletableFuture<Void> deleteSignalNotificationRuleAsync(String id) { + return deleteSignalNotificationRuleWithHttpInfoAsync(id) .thenApply( response -> { return response.getData(); @@ -2265,112 +2561,81 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Modify the triage assignee of a security signal. + * Delete a notification rule for security signals. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> + * @param id ID of the notification rule. (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * <table border="1"> * <caption>Response details</caption> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> - * <tr><td> 200 </td><td> OK </td><td> - </td></tr> - * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 204 </td><td> Rule successfully deleted. </td><td> - </td></tr> * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> * </table> */ - public ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> - 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<Void> deleteSignalNotificationRuleWithHttpInfo(String id) throws ApiException { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'id' is set + if (id == null) { throw new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalAssignee"); + 400, "Missing the required parameter 'id' when calling deleteSignalNotificationRule"); } // 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/signals/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", + "v2.SecurityMonitoringApi.deleteSignalNotificationRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, new HashMap<String, String>(), - 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<String, Object>(), false, - new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); + null); } /** - * Modify the triage assignee of a security signal. + * Delete a signal-based rule. * - * <p>See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. + * <p>See {@link #deleteSignalNotificationRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> + * @param id ID of the notification rule. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> - editSecurityMonitoringSignalAssigneeWithHttpInfoAsync( - String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { - Object localVarPostBody = body; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalAssignee")); - return result; - } + public CompletableFuture<ApiResponse<Void>> deleteSignalNotificationRuleWithHttpInfoAsync( + String id) { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = - new CompletableFuture<>(); + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalAssignee")); + "Missing the required parameter 'id' when calling deleteSignalNotificationRule")); 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/signals/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -2378,58 +2643,51 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", + "v2.SecurityMonitoringApi.deleteSignalNotificationRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, new HashMap<String, String>(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = - new CompletableFuture<>(); + CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); + null); } /** - * Change the related incidents of a security signal. + * Delete a vulnerability-based rule. * - * <p>See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. + * <p>See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return SecurityMonitoringSignalTriageUpdateResponse + * @param id ID of the notification 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 deleteVulnerabilityNotificationRule(String id) throws ApiException { + deleteVulnerabilityNotificationRuleWithHttpInfo(id); } /** - * Change the related incidents of a security signal. + * Delete a vulnerability-based rule. * - * <p>See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfoAsync}. + * <p>See {@link #deleteVulnerabilityNotificationRuleWithHttpInfoAsync}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + * @param id ID of the notification rule. (required) + * @return CompletableFuture */ - public CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> - editSecurityMonitoringSignalIncidentsAsync( - String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { - return editSecurityMonitoringSignalIncidentsWithHttpInfoAsync(signalId, body) + public CompletableFuture<Void> deleteVulnerabilityNotificationRuleAsync(String id) { + return deleteVulnerabilityNotificationRuleWithHttpInfoAsync(id) .thenApply( response -> { return response.getData(); @@ -2437,113 +2695,84 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Change the related incidents for a security signal. + * Delete a notification rule for security vulnerabilities. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> + * @param id ID of the notification rule. (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * <table border="1"> * <caption>Response details</caption> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> - * <tr><td> 200 </td><td> OK </td><td> - </td></tr> - * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 204 </td><td> Rule successfully deleted. </td><td> - </td></tr> * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> * </table> */ - public ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> - editSecurityMonitoringSignalIncidentsWithHttpInfo( - String signalId, SecurityMonitoringSignalIncidentsUpdateRequest 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" - + " editSecurityMonitoringSignalIncidents"); - } + public ApiResponse<Void> deleteVulnerabilityNotificationRuleWithHttpInfo(String id) + throws ApiException { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'id' is set + if (id == null) { throw new ApiException( 400, - "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalIncidents"); + "Missing the required parameter 'id' when calling deleteVulnerabilityNotificationRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/incidents" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security/vulnerabilities/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", + "v2.SecurityMonitoringApi.deleteVulnerabilityNotificationRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, new HashMap<String, String>(), - 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<String, Object>(), false, - new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); + null); } /** - * Change the related incidents of a security signal. + * Delete a vulnerability-based rule. * - * <p>See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. + * <p>See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> + * @param id ID of the notification rule. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> - editSecurityMonitoringSignalIncidentsWithHttpInfoAsync( - String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { - Object localVarPostBody = body; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalIncidents")); - return result; - } + public CompletableFuture<ApiResponse<Void>> deleteVulnerabilityNotificationRuleWithHttpInfoAsync( + String id) { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = - new CompletableFuture<>(); + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalIncidents")); + "Missing the required parameter 'id' when calling" + + " deleteVulnerabilityNotificationRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/incidents" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security/vulnerabilities/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -2551,58 +2780,57 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", + "v2.SecurityMonitoringApi.deleteVulnerabilityNotificationRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, new HashMap<String, String>(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"*/*"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = - new CompletableFuture<>(); + CompletableFuture<ApiResponse<Void>> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); + null); } /** - * Change the triage state of a security signal. + * Modify the triage assignee of a security signal. * - * <p>See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. + * <p>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 editSecurityMonitoringSignalState( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) throws ApiException { - return editSecurityMonitoringSignalStateWithHttpInfo(signalId, body).getData(); + public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalAssignee( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) throws ApiException { + return editSecurityMonitoringSignalAssigneeWithHttpInfo(signalId, body).getData(); } /** - * Change the triage state of a security signal. + * Modify the triage assignee of a security signal. * - * <p>See {@link #editSecurityMonitoringSignalStateWithHttpInfoAsync}. + * <p>See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfoAsync}. * * @param signalId The ID of the signal. (required) * @param body Attributes describing the signal update. (required) * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> */ public CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> - editSecurityMonitoringSignalStateAsync( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) { - return editSecurityMonitoringSignalStateWithHttpInfoAsync(signalId, body) + editSecurityMonitoringSignalAssigneeAsync( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { + return editSecurityMonitoringSignalAssigneeWithHttpInfoAsync(signalId, body) .thenApply( response -> { return response.getData(); @@ -2610,7 +2838,7 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Change the triage state of a security signal. + * Modify the triage assignee of a security signal. * * @param signalId The ID of the signal. (required) * @param body Attributes describing the signal update. (required) @@ -2628,8 +2856,8 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal * </table> */ public ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> - editSecurityMonitoringSignalStateWithHttpInfo( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) throws ApiException { + editSecurityMonitoringSignalAssigneeWithHttpInfo( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) throws ApiException { Object localVarPostBody = body; // verify the required parameter 'signalId' is set @@ -2637,25 +2865,26 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal throw new ApiException( 400, "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalState"); + + " editSecurityMonitoringSignalAssignee"); } // 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" + + " editSecurityMonitoringSignalAssignee"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/state" + "/api/v2/security_monitoring/signals/{signal_id}/assignee" .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -2674,9 +2903,9 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Change the triage state of a security signal. + * Modify the triage assignee of a security signal. * - * <p>See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. + * <p>See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. * * @param signalId The ID of the signal. (required) * @param body Attributes describing the signal update. (required) @@ -2684,8 +2913,8 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> */ public CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> - editSecurityMonitoringSignalStateWithHttpInfoAsync( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) { + editSecurityMonitoringSignalAssigneeWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { Object localVarPostBody = body; // verify the required parameter 'signalId' is set @@ -2696,25 +2925,985 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal new ApiException( 400, "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalState")); + + " editSecurityMonitoringSignalAssignee")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " editSecurityMonitoringSignalAssignee")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}/assignee" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); + } + + /** + * Change the related incidents of a security signal. + * + * <p>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 editSecurityMonitoringSignalIncidents( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) throws ApiException { + return editSecurityMonitoringSignalIncidentsWithHttpInfo(signalId, body).getData(); + } + + /** + * Change the related incidents of a security signal. + * + * <p>See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfoAsync}. + * + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + */ + public CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + editSecurityMonitoringSignalIncidentsAsync( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { + return editSecurityMonitoringSignalIncidentsWithHttpInfoAsync(signalId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Change the related incidents for 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 + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> + editSecurityMonitoringSignalIncidentsWithHttpInfo( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest 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" + + " editSecurityMonitoringSignalIncidents"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " editSecurityMonitoringSignalIncidents"); + } + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}/incidents" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); + } + + /** + * Change the related incidents of a security signal. + * + * <p>See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. + * + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> + */ + public CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> + editSecurityMonitoringSignalIncidentsWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'signalId' when calling" + + " editSecurityMonitoringSignalIncidents")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " editSecurityMonitoringSignalIncidents")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}/incidents" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); return result; } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); + } + + /** + * Change the triage state of a security signal. + * + * <p>See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. + * + * @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. + * + * <p>See {@link #editSecurityMonitoringSignalStateWithHttpInfoAsync}. + * + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + */ + public CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + 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 + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> + 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); + } + + /** + * Change the triage state of a security signal. + * + * <p>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<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> + editSecurityMonitoringSignalStateWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalStateUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> 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<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); + } + + /** 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. + * + * <p>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(); + } + + /** + * Get a finding. + * + * <p>See {@link #getFindingWithHttpInfoAsync}. + * + * @param findingId The ID of the finding. (required) + * @return CompletableFuture<GetFindingResponse> + */ + public CompletableFuture<GetFindingResponse> getFindingAsync(String findingId) { + return getFindingWithHttpInfoAsync(findingId, new GetFindingOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a finding. + * + * <p>See {@link #getFindingWithHttpInfo}. + * + * @param findingId The ID of the finding. (required) + * @param parameters Optional parameters for the request. + * @return GetFindingResponse + * @throws ApiException if fails to make API call + */ + public GetFindingResponse getFinding(String findingId, GetFindingOptionalParameters parameters) + throws ApiException { + return getFindingWithHttpInfo(findingId, parameters).getData(); + } + + /** + * Get a finding. + * + * <p>See {@link #getFindingWithHttpInfoAsync}. + * + * @param findingId The ID of the finding. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<GetFindingResponse> + */ + public CompletableFuture<GetFindingResponse> getFindingAsync( + String findingId, GetFindingOptionalParameters parameters) { + return getFindingWithHttpInfoAsync(findingId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns a single finding with message and resource configuration. + * + * @param findingId The ID of the finding. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<GetFindingResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request: The server cannot process the request due to invalid syntax in the request. </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden: Access denied </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found: The requested finding cannot be found. </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests: The rate limit set by the API has been exceeded. </td><td> - </td></tr> + * </table> + */ + public ApiResponse<GetFindingResponse> getFindingWithHttpInfo( + String findingId, GetFindingOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getFinding"; + 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 'findingId' is set + if (findingId == null) { + throw new ApiException( + 400, "Missing the required parameter 'findingId' when calling getFinding"); + } + Long snapshotTimestamp = parameters.snapshotTimestamp; + // create path and map variables + String localVarPath = + "/api/v2/posture_management/findings/{finding_id}" + .replaceAll("\\{" + "finding_id" + "\\}", apiClient.escapeString(findingId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getFinding", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<GetFindingResponse>() {}); + } + + /** + * Get a finding. + * + * <p>See {@link #getFindingWithHttpInfo}. + * + * @param findingId The ID of the finding. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<GetFindingResponse>> + */ + public CompletableFuture<ApiResponse<GetFindingResponse>> getFindingWithHttpInfoAsync( + String findingId, GetFindingOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getFinding"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture<ApiResponse<GetFindingResponse>> 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 'findingId' is set + if (findingId == null) { + CompletableFuture<ApiResponse<GetFindingResponse>> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'findingId' when calling getFinding")); + return result; + } + Long snapshotTimestamp = parameters.snapshotTimestamp; + // create path and map variables + String localVarPath = + "/api/v2/posture_management/findings/{finding_id}" + .replaceAll("\\{" + "finding_id" + "\\}", apiClient.escapeString(findingId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getFinding", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<GetFindingResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<GetFindingResponse>() {}); + } + + /** + * Get a job's details. + * + * <p>See {@link #getHistoricalJobWithHttpInfo}. + * + * @param jobId The ID of the job. (required) + * @return HistoricalJobResponse + * @throws ApiException if fails to make API call + */ + public HistoricalJobResponse getHistoricalJob(String jobId) throws ApiException { + return getHistoricalJobWithHttpInfo(jobId).getData(); + } + + /** + * Get a job's details. + * + * <p>See {@link #getHistoricalJobWithHttpInfoAsync}. + * + * @param jobId The ID of the job. (required) + * @return CompletableFuture<HistoricalJobResponse> + */ + public CompletableFuture<HistoricalJobResponse> getHistoricalJobAsync(String jobId) { + return getHistoricalJobWithHttpInfoAsync(jobId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a job's details. + * + * @param jobId The ID of the job. (required) + * @return ApiResponse<HistoricalJobResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> OK </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<HistoricalJobResponse> getHistoricalJobWithHttpInfo(String jobId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getHistoricalJob"; + 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 'jobId' is set + if (jobId == null) { + throw new ApiException( + 400, "Missing the required parameter 'jobId' when calling getHistoricalJob"); + } + // create path and map variables + String localVarPath = + "/api/v2/siem-historical-detections/jobs/{job_id}" + .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getHistoricalJob", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<HistoricalJobResponse>() {}); + } + + /** + * Get a job's details. + * + * <p>See {@link #getHistoricalJobWithHttpInfo}. + * + * @param jobId The ID of the job. (required) + * @return CompletableFuture<ApiResponse<HistoricalJobResponse>> + */ + public CompletableFuture<ApiResponse<HistoricalJobResponse>> getHistoricalJobWithHttpInfoAsync( + String jobId) { + // Check if unstable operation is enabled + String operationId = "getHistoricalJob"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture<ApiResponse<HistoricalJobResponse>> 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 'jobId' is set + if (jobId == null) { + CompletableFuture<ApiResponse<HistoricalJobResponse>> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'jobId' when calling getHistoricalJob")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/siem-historical-detections/jobs/{job_id}" + .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getHistoricalJob", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<HistoricalJobResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<HistoricalJobResponse>() {}); + } + + /** + * Get details of an inbox rule. + * + * <p>See {@link #getInboxRuleWithHttpInfo}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @return InboxRuleResponse + * @throws ApiException if fails to make API call + */ + public InboxRuleResponse getInboxRule(UUID inboxRuleId) throws ApiException { + return getInboxRuleWithHttpInfo(inboxRuleId).getData(); + } + + /** + * Get details of an inbox rule. + * + * <p>See {@link #getInboxRuleWithHttpInfoAsync}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @return CompletableFuture<InboxRuleResponse> + */ + public CompletableFuture<InboxRuleResponse> getInboxRuleAsync(UUID inboxRuleId) { + return getInboxRuleWithHttpInfoAsync(inboxRuleId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the details of an inbox rule. + * + * @param inboxRuleId ID of the inbox rule (required) + * @return ApiResponse<InboxRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> Inbox rule details </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<InboxRuleResponse> getInboxRuleWithHttpInfo(UUID inboxRuleId) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { + throw new ApiException( + 400, "Missing the required parameter 'inboxRuleId' when calling getInboxRule"); + } + // 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getInboxRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<InboxRuleResponse>() {}); + } + + /** + * Get details of an inbox rule. + * + * <p>See {@link #getInboxRuleWithHttpInfo}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @return CompletableFuture<ApiResponse<InboxRuleResponse>> + */ + public CompletableFuture<ApiResponse<InboxRuleResponse>> getInboxRuleWithHttpInfoAsync( + UUID inboxRuleId) { + Object localVarPostBody = null; + + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { + CompletableFuture<ApiResponse<InboxRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'inboxRuleId' when calling getInboxRule")); + 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getInboxRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<InboxRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<InboxRuleResponse>() {}); + } + + /** + * Get the ordered list of inbox rules. + * + * <p>See {@link #getInboxRulesWithHttpInfo}. + * + * @return Object + * @throws ApiException if fails to make API call + */ + public Object getInboxRules() throws ApiException { + return getInboxRulesWithHttpInfo().getData(); + } + + /** + * Get the ordered list of inbox rules. + * + * <p>See {@link #getInboxRulesWithHttpInfoAsync}. + * + * @return CompletableFuture<Object> + */ + public CompletableFuture<Object> getInboxRulesAsync() { + return getInboxRulesWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Returns the ordered list of inbox rules in the pipeline (first match applies) + * + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + * @http.response.details + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> The list of inbox rules </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<Object> getInboxRulesWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules"; + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getInboxRules", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<Object>() {}); + } - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalState")); - return result; - } + /** + * Get the ordered list of inbox rules. + * + * <p>See {@link #getInboxRulesWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<Object>> + */ + public CompletableFuture<ApiResponse<Object>> getInboxRulesWithHttpInfoAsync() { + Object localVarPostBody = null; // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/state" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules"; Map<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -2722,103 +3911,52 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + "v2.SecurityMonitoringApi.getInboxRules", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, new HashMap<String, String>(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> result = - new CompletableFuture<>(); + CompletableFuture<ApiResponse<Object>> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "GET", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<SecurityMonitoringSignalTriageUpdateResponse>() {}); - } - - /** 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. - * - * <p>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(); - } - - /** - * Get a finding. - * - * <p>See {@link #getFindingWithHttpInfoAsync}. - * - * @param findingId The ID of the finding. (required) - * @return CompletableFuture<GetFindingResponse> - */ - public CompletableFuture<GetFindingResponse> getFindingAsync(String findingId) { - return getFindingWithHttpInfoAsync(findingId, new GetFindingOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType<Object>() {}); } /** - * Get a finding. + * Get details of a mute rule. * - * <p>See {@link #getFindingWithHttpInfo}. + * <p>See {@link #getMuteRuleWithHttpInfo}. * - * @param findingId The ID of the finding. (required) - * @param parameters Optional parameters for the request. - * @return GetFindingResponse + * @param muteRuleId ID of the mute rule (required) + * @return MuteRuleResponse * @throws ApiException if fails to make API call */ - public GetFindingResponse getFinding(String findingId, GetFindingOptionalParameters parameters) - throws ApiException { - return getFindingWithHttpInfo(findingId, parameters).getData(); + public MuteRuleResponse getMuteRule(UUID muteRuleId) throws ApiException { + return getMuteRuleWithHttpInfo(muteRuleId).getData(); } /** - * Get a finding. + * Get details of a mute rule. * - * <p>See {@link #getFindingWithHttpInfoAsync}. + * <p>See {@link #getMuteRuleWithHttpInfoAsync}. * - * @param findingId The ID of the finding. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<GetFindingResponse> + * @param muteRuleId ID of the mute rule (required) + * @return CompletableFuture<MuteRuleResponse> */ - public CompletableFuture<GetFindingResponse> getFindingAsync( - String findingId, GetFindingOptionalParameters parameters) { - return getFindingWithHttpInfoAsync(findingId, parameters) + public CompletableFuture<MuteRuleResponse> getMuteRuleAsync(UUID muteRuleId) { + return getMuteRuleWithHttpInfoAsync(muteRuleId) .thenApply( response -> { return response.getData(); @@ -2826,56 +3964,44 @@ public CompletableFuture<GetFindingResponse> getFindingAsync( } /** - * Returns a single finding with message and resource configuration. + * Get the details of a mute rule. * - * @param findingId The ID of the finding. (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<GetFindingResponse> + * @param muteRuleId ID of the mute rule (required) + * @return ApiResponse<MuteRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * <table border="1"> * <caption>Response details</caption> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> - * <tr><td> 200 </td><td> OK </td><td> - </td></tr> - * <tr><td> 400 </td><td> Bad Request: The server cannot process the request due to invalid syntax in the request. </td><td> - </td></tr> - * <tr><td> 403 </td><td> Forbidden: Access denied </td><td> - </td></tr> - * <tr><td> 404 </td><td> Not Found: The requested finding cannot be found. </td><td> - </td></tr> - * <tr><td> 429 </td><td> Too many requests: The rate limit set by the API has been exceeded. </td><td> - </td></tr> + * <tr><td> 200 </td><td> Mute rule details </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> * </table> */ - public ApiResponse<GetFindingResponse> getFindingWithHttpInfo( - String findingId, GetFindingOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "getFinding"; - 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<MuteRuleResponse> getMuteRuleWithHttpInfo(UUID muteRuleId) + throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'findingId' is set - if (findingId == null) { + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { throw new ApiException( - 400, "Missing the required parameter 'findingId' when calling getFinding"); + 400, "Missing the required parameter 'muteRuleId' when calling getMuteRule"); } - Long snapshotTimestamp = parameters.snapshotTimestamp; // create path and map variables String localVarPath = - "/api/v2/posture_management/findings/{finding_id}" - .replaceAll("\\{" + "finding_id" + "\\}", apiClient.escapeString(findingId.toString())); + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); - List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getFinding", + "v2.SecurityMonitoringApi.getMuteRule", localVarPath, - localVarQueryParams, + new ArrayList<Pair>(), localVarHeaderParams, new HashMap<String, String>(), new String[] {"application/json"}, @@ -2888,65 +4014,50 @@ public ApiResponse<GetFindingResponse> getFindingWithHttpInfo( localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<GetFindingResponse>() {}); + new GenericType<MuteRuleResponse>() {}); } /** - * Get a finding. + * Get details of a mute rule. * - * <p>See {@link #getFindingWithHttpInfo}. + * <p>See {@link #getMuteRuleWithHttpInfo}. * - * @param findingId The ID of the finding. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<GetFindingResponse>> + * @param muteRuleId ID of the mute rule (required) + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> */ - public CompletableFuture<ApiResponse<GetFindingResponse>> getFindingWithHttpInfoAsync( - String findingId, GetFindingOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "getFinding"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture<ApiResponse<GetFindingResponse>> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture<ApiResponse<MuteRuleResponse>> getMuteRuleWithHttpInfoAsync( + UUID muteRuleId) { Object localVarPostBody = null; - // verify the required parameter 'findingId' is set - if (findingId == null) { - CompletableFuture<ApiResponse<GetFindingResponse>> result = new CompletableFuture<>(); + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { + CompletableFuture<ApiResponse<MuteRuleResponse>> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'findingId' when calling getFinding")); + 400, "Missing the required parameter 'muteRuleId' when calling getMuteRule")); return result; } - Long snapshotTimestamp = parameters.snapshotTimestamp; // create path and map variables String localVarPath = - "/api/v2/posture_management/findings/{finding_id}" - .replaceAll("\\{" + "finding_id" + "\\}", apiClient.escapeString(findingId.toString())); + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); - List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getFinding", + "v2.SecurityMonitoringApi.getMuteRule", localVarPath, - localVarQueryParams, + new ArrayList<Pair>(), localVarHeaderParams, new HashMap<String, String>(), new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture<ApiResponse<GetFindingResponse>> result = new CompletableFuture<>(); + CompletableFuture<ApiResponse<MuteRuleResponse>> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -2958,32 +4069,30 @@ public CompletableFuture<ApiResponse<GetFindingResponse>> getFindingWithHttpInfo localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<GetFindingResponse>() {}); + new GenericType<MuteRuleResponse>() {}); } /** - * Get a job's details. + * Get the ordered list of mute rules. * - * <p>See {@link #getHistoricalJobWithHttpInfo}. + * <p>See {@link #getMuteRulesWithHttpInfo}. * - * @param jobId The ID of the job. (required) - * @return HistoricalJobResponse + * @return Object * @throws ApiException if fails to make API call */ - public HistoricalJobResponse getHistoricalJob(String jobId) throws ApiException { - return getHistoricalJobWithHttpInfo(jobId).getData(); + public Object getMuteRules() throws ApiException { + return getMuteRulesWithHttpInfo().getData(); } /** - * Get a job's details. + * Get the ordered list of mute rules. * - * <p>See {@link #getHistoricalJobWithHttpInfoAsync}. + * <p>See {@link #getMuteRulesWithHttpInfoAsync}. * - * @param jobId The ID of the job. (required) - * @return CompletableFuture<HistoricalJobResponse> + * @return CompletableFuture<Object> */ - public CompletableFuture<HistoricalJobResponse> getHistoricalJobAsync(String jobId) { - return getHistoricalJobWithHttpInfoAsync(jobId) + public CompletableFuture<Object> getMuteRulesAsync() { + return getMuteRulesWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -2991,48 +4100,29 @@ public CompletableFuture<HistoricalJobResponse> getHistoricalJobAsync(String job } /** - * Get a job's details. + * Returns the ordered list of mute rules in the pipeline (first match applies) * - * @param jobId The ID of the job. (required) - * @return ApiResponse<HistoricalJobResponse> + * @return ApiResponse<Object> * @throws ApiException if fails to make API call * @http.response.details * <table border="1"> * <caption>Response details</caption> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> - * <tr><td> 200 </td><td> OK </td><td> - </td></tr> - * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> - * <tr><td> 403 </td><td> Not Authorized </td><td> - </td></tr> - * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 200 </td><td> The list of mute rules </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> * </table> */ - public ApiResponse<HistoricalJobResponse> getHistoricalJobWithHttpInfo(String jobId) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "getHistoricalJob"; - 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<Object> getMuteRulesWithHttpInfo() throws ApiException { Object localVarPostBody = null; - - // verify the required parameter 'jobId' is set - if (jobId == null) { - throw new ApiException( - 400, "Missing the required parameter 'jobId' when calling getHistoricalJob"); - } // create path and map variables - String localVarPath = - "/api/v2/siem-historical-detections/jobs/{job_id}" - .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules"; Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getHistoricalJob", + "v2.SecurityMonitoringApi.getMuteRules", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -3047,43 +4137,20 @@ public ApiResponse<HistoricalJobResponse> getHistoricalJobWithHttpInfo(String jo localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<HistoricalJobResponse>() {}); + new GenericType<Object>() {}); } /** - * Get a job's details. + * Get the ordered list of mute rules. * - * <p>See {@link #getHistoricalJobWithHttpInfo}. + * <p>See {@link #getMuteRulesWithHttpInfo}. * - * @param jobId The ID of the job. (required) - * @return CompletableFuture<ApiResponse<HistoricalJobResponse>> + * @return CompletableFuture<ApiResponse<Object>> */ - public CompletableFuture<ApiResponse<HistoricalJobResponse>> getHistoricalJobWithHttpInfoAsync( - String jobId) { - // Check if unstable operation is enabled - String operationId = "getHistoricalJob"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture<ApiResponse<HistoricalJobResponse>> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture<ApiResponse<Object>> getMuteRulesWithHttpInfoAsync() { Object localVarPostBody = null; - - // verify the required parameter 'jobId' is set - if (jobId == null) { - CompletableFuture<ApiResponse<HistoricalJobResponse>> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'jobId' when calling getHistoricalJob")); - return result; - } // create path and map variables - String localVarPath = - "/api/v2/siem-historical-detections/jobs/{job_id}" - .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules"; Map<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -3091,7 +4158,7 @@ public CompletableFuture<ApiResponse<HistoricalJobResponse>> getHistoricalJobWit try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getHistoricalJob", + "v2.SecurityMonitoringApi.getMuteRules", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -3099,7 +4166,7 @@ public CompletableFuture<ApiResponse<HistoricalJobResponse>> getHistoricalJobWit new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture<ApiResponse<HistoricalJobResponse>> result = new CompletableFuture<>(); + CompletableFuture<ApiResponse<Object>> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -3111,7 +4178,7 @@ public CompletableFuture<ApiResponse<HistoricalJobResponse>> getHistoricalJobWit localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<HistoricalJobResponse>() {}); + new GenericType<Object>() {}); } /** Manage optional parameters to getSBOM. */ @@ -7517,22 +8584,349 @@ public ApiResponse<BulkMuteFindingsResponse> muteFindingsWithHttpInfo( // 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 muteFindings"); + } + // create path and map variables + String localVarPath = "/api/v2/posture_management/findings"; + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.muteFindings", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<BulkMuteFindingsResponse>() {}); + } + + /** + * Mute or unmute a batch of findings. + * + * <p>See {@link #muteFindingsWithHttpInfo}. + * + * @param body + * <h3>Attributes</h3> + * All findings are updated with the same attributes. The request body must include at least + * two attributes: <code>muted</code> and <code>reason</code>. The allowed reasons depend on + * whether the finding is being muted or unmuted: - To mute a finding: <code>PENDING_FIX + * </code>, <code>FALSE_POSITIVE</code>, <code>ACCEPTED_RISK</code>, <code>OTHER</code>. - To + * unmute a finding : <code>NO_PENDING_FIX</code>, <code>HUMAN_ERROR</code>, <code> + * NO_LONGER_ACCEPTED_RISK</code>, <code>OTHER</code>. + * <h3>Meta</h3> + * The request body must include a list of the finding IDs to be updated. (required) + * @return CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> + */ + public CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> 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<ApiResponse<BulkMuteFindingsResponse>> 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<ApiResponse<BulkMuteFindingsResponse>> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.muteFindings", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<BulkMuteFindingsResponse>() {}); + } + + /** + * Patch an inbox rule. + * + * <p>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(); + } + + /** + * Patch an inbox rule. + * + * <p>See {@link #patchInboxRuleWithHttpInfoAsync}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return CompletableFuture<InboxRuleResponse> + */ + public CompletableFuture<InboxRuleResponse> patchInboxRuleAsync( + UUID inboxRuleId, PatchInboxRulesParameters body) { + return patchInboxRuleWithHttpInfoAsync(inboxRuleId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Partially update the inbox rule. All fields are optional; if a field is not provided, it is not + * 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 + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> Inbox rule successfully patched </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 422 </td><td> The server cannot process the request because it contains invalid data. </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<InboxRuleResponse> patchInboxRuleWithHttpInfo( + UUID inboxRuleId, PatchInboxRulesParameters 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 patchInboxRule"); + } + + // 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())); + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.patchInboxRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<InboxRuleResponse>() {}); + } + + /** + * Patch an inbox rule. + * + * <p>See {@link #patchInboxRuleWithHttpInfo}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<InboxRuleResponse>> + */ + public CompletableFuture<ApiResponse<InboxRuleResponse>> patchInboxRuleWithHttpInfoAsync( + UUID inboxRuleId, PatchInboxRulesParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { + CompletableFuture<ApiResponse<InboxRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'inboxRuleId' when calling patchInboxRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture<ApiResponse<InboxRuleResponse>> 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())); + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.patchInboxRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<InboxRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<InboxRuleResponse>() {}); + } + + /** + * Patch a mute rule. + * + * <p>See {@link #patchMuteRuleWithHttpInfo}. + * + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return MuteRuleResponse + * @throws ApiException if fails to make API call + */ + public MuteRuleResponse patchMuteRule(UUID muteRuleId, PatchMuteRuleParameters body) + throws ApiException { + return patchMuteRuleWithHttpInfo(muteRuleId, body).getData(); + } + + /** + * Patch a mute rule. + * + * <p>See {@link #patchMuteRuleWithHttpInfoAsync}. + * + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return CompletableFuture<MuteRuleResponse> + */ + public CompletableFuture<MuteRuleResponse> patchMuteRuleAsync( + UUID muteRuleId, PatchMuteRuleParameters body) { + return patchMuteRuleWithHttpInfoAsync(muteRuleId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Partially update the mute rule. All fields are optional; if a field is not provided, it is not + * updated. + * + * @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 + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> Mute rule successfully patched </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 422 </td><td> The server cannot process the request because it contains invalid data. </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<MuteRuleResponse> 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/posture_management/findings"; + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.muteFindings", + "v2.SecurityMonitoringApi.patchMuteRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, new HashMap<String, String>(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "PATCH", builder, @@ -7541,49 +8935,44 @@ public ApiResponse<BulkMuteFindingsResponse> muteFindingsWithHttpInfo( localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<BulkMuteFindingsResponse>() {}); + new GenericType<MuteRuleResponse>() {}); } /** - * Mute or unmute a batch of findings. + * Patch a mute rule. * - * <p>See {@link #muteFindingsWithHttpInfo}. + * <p>See {@link #patchMuteRuleWithHttpInfo}. * - * @param body - * <h3>Attributes</h3> - * All findings are updated with the same attributes. The request body must include at least - * two attributes: <code>muted</code> and <code>reason</code>. The allowed reasons depend on - * whether the finding is being muted or unmuted: - To mute a finding: <code>PENDING_FIX - * </code>, <code>FALSE_POSITIVE</code>, <code>ACCEPTED_RISK</code>, <code>OTHER</code>. - To - * unmute a finding : <code>NO_PENDING_FIX</code>, <code>HUMAN_ERROR</code>, <code> - * NO_LONGER_ACCEPTED_RISK</code>, <code>OTHER</code>. - * <h3>Meta</h3> - * The request body must include a list of the finding IDs to be updated. (required) - * @return CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> */ - public CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> 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<ApiResponse<BulkMuteFindingsResponse>> result = new CompletableFuture<>(); + public CompletableFuture<ApiResponse<MuteRuleResponse>> patchMuteRuleWithHttpInfoAsync( + UUID muteRuleId, PatchMuteRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { + CompletableFuture<ApiResponse<MuteRuleResponse>> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, "Missing the required parameter 'muteRuleId' when calling patchMuteRule")); return result; } - Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> result = new CompletableFuture<>(); + CompletableFuture<ApiResponse<MuteRuleResponse>> 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 patchMuteRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/posture_management/findings"; + String localVarPath = + "/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}" + .replaceAll( + "\\{" + "mute_rule_id" + "\\}", apiClient.escapeString(muteRuleId.toString())); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -7591,15 +8980,15 @@ public CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> muteFindingsWith try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.muteFindings", + "v2.SecurityMonitoringApi.patchMuteRule", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, new HashMap<String, String>(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> result = new CompletableFuture<>(); + CompletableFuture<ApiResponse<MuteRuleResponse>> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -7611,7 +9000,7 @@ public CompletableFuture<ApiResponse<BulkMuteFindingsResponse>> muteFindingsWith localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<BulkMuteFindingsResponse>() {}); + new GenericType<MuteRuleResponse>() {}); } /** @@ -7899,18 +9288,290 @@ public ApiResponse<NotificationRuleResponse> patchVulnerabilityNotificationRuleW // verify the required parameter 'body' is set if (body == null) { - CompletableFuture<ApiResponse<NotificationRuleResponse>> result = new CompletableFuture<>(); + CompletableFuture<ApiResponse<NotificationRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " patchVulnerabilityNotificationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security/vulnerabilities/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.patchVulnerabilityNotificationRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<NotificationRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<NotificationRuleResponse>() {}); + } + + /** + * Reorder the list of inbox rules in the pipeline. + * + * <p>See {@link #reorderInboxRulesWithHttpInfo}. + * + * @param body The list of rules to reorder. The order of the rules in the list becomes 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. + * + * <p>See {@link #reorderInboxRulesWithHttpInfoAsync}. + * + * @param body The list of rules to reorder. The order of the rules in the list becomes the new + * order in the pipeline. (required) + * @return CompletableFuture<Object> + */ + public CompletableFuture<Object> 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 must provide the full list of pipeline rules in the new order. + * + * @param body The list of rules to reorder. The order of the rules in the list becomes the new + * order in the pipeline. (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + * @http.response.details + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> The list of inbox rules </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<Object> 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"); + } + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder"; + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.reorderInboxRules", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<Object>() {}); + } + + /** + * Reorder the list of inbox rules in the pipeline. + * + * <p>See {@link #reorderInboxRulesWithHttpInfo}. + * + * @param body The list of rules to reorder. The order of the rules in the list becomes the new + * order in the pipeline. (required) + * @return CompletableFuture<ApiResponse<Object>> + */ + public CompletableFuture<ApiResponse<Object>> reorderInboxRulesWithHttpInfoAsync( + ReorderInboxRulesParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture<ApiResponse<Object>> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling reorderInboxRules")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder"; + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.reorderInboxRules", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<Object>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<Object>() {}); + } + + /** + * Reorder the list of mute rules in the pipeline. + * + * <p>See {@link #reorderMuteRulesWithHttpInfo}. + * + * @param body The list of rules to reorder. The order of the rules in the list becomes the new + * order in the pipeline. (required) + * @return Object + * @throws ApiException if fails to make API call + */ + public Object reorderMuteRules(ReorderMuteRulesParameters body) throws ApiException { + return reorderMuteRulesWithHttpInfo(body).getData(); + } + + /** + * Reorder the list of mute rules in the pipeline. + * + * <p>See {@link #reorderMuteRulesWithHttpInfoAsync}. + * + * @param body The list of rules to reorder. The order of the rules in the list becomes the new + * order in the pipeline. (required) + * @return CompletableFuture<Object> + */ + public CompletableFuture<Object> reorderMuteRulesAsync(ReorderMuteRulesParameters body) { + return reorderMuteRulesWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Reorder the list of mute rules in the pipeline and return the reordered list of rules. To + * reorder fields, you must provide the full list of pipeline rules in the new order. + * + * @param body The list of rules to reorder. The order of the rules in the list becomes the new + * order in the pipeline. (required) + * @return ApiResponse<Object> + * @throws ApiException if fails to make API call + * @http.response.details + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> The list of mute rules </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<Object> 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 reorderMuteRules"); + } + // create path and map variables + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules/reorder"; + + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.reorderMuteRules", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<Object>() {}); + } + + /** + * Reorder the list of mute rules in the pipeline. + * + * <p>See {@link #reorderMuteRulesWithHttpInfo}. + * + * @param body The list of rules to reorder. The order of the rules in the list becomes the new + * order in the pipeline. (required) + * @return CompletableFuture<ApiResponse<Object>> + */ + public CompletableFuture<ApiResponse<Object>> reorderMuteRulesWithHttpInfoAsync( + ReorderMuteRulesParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture<ApiResponse<Object>> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " patchVulnerabilityNotificationRule")); + 400, "Missing the required parameter 'body' when calling reorderMuteRules")); return result; } // create path and map variables - String localVarPath = - "/api/v2/security/vulnerabilities/notification_rules/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + String localVarPath = "/api/v2/security/vulnerabilities/pipelines/mute_rules/reorder"; Map<String, String> localVarHeaderParams = new HashMap<String, String>(); @@ -7918,7 +9579,7 @@ public ApiResponse<NotificationRuleResponse> patchVulnerabilityNotificationRuleW try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.patchVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.reorderMuteRules", localVarPath, new ArrayList<Pair>(), localVarHeaderParams, @@ -7926,19 +9587,19 @@ public ApiResponse<NotificationRuleResponse> patchVulnerabilityNotificationRuleW new String[] {"application/json"}, new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture<ApiResponse<NotificationRuleResponse>> result = new CompletableFuture<>(); + CompletableFuture<ApiResponse<Object>> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "POST", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap<String, Object>(), false, - new GenericType<NotificationRuleResponse>() {}); + new GenericType<Object>() {}); } /** @@ -8634,6 +10295,328 @@ public ApiResponse<SecurityMonitoringRuleTestResponse> testSecurityMonitoringRul new GenericType<SecurityMonitoringRuleTestResponse>() {}); } + /** + * Update an inbox rule. + * + * <p>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. + * + * <p>See {@link #updateInboxRuleWithHttpInfoAsync}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return CompletableFuture<InboxRuleResponse> + */ + public CompletableFuture<InboxRuleResponse> 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 is 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 + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> Inbox rule successfully updated </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 422 </td><td> The server cannot process the request because it contains invalid data. </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<InboxRuleResponse> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateInboxRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<InboxRuleResponse>() {}); + } + + /** + * Update an inbox rule. + * + * <p>See {@link #updateInboxRuleWithHttpInfo}. + * + * @param inboxRuleId ID of the inbox rule (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<InboxRuleResponse>> + */ + public CompletableFuture<ApiResponse<InboxRuleResponse>> updateInboxRuleWithHttpInfoAsync( + UUID inboxRuleId, UpdateInboxRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'inboxRuleId' is set + if (inboxRuleId == null) { + CompletableFuture<ApiResponse<InboxRuleResponse>> 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<ApiResponse<InboxRuleResponse>> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateInboxRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<InboxRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<InboxRuleResponse>() {}); + } + + /** + * Update a mute rule. + * + * <p>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. + * + * <p>See {@link #updateMuteRuleWithHttpInfoAsync}. + * + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return CompletableFuture<MuteRuleResponse> + */ + public CompletableFuture<MuteRuleResponse> 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 is 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 + * <table border="1"> + * <caption>Response details</caption> + * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + * <tr><td> 200 </td><td> Mute rule successfully updated </td><td> - </td></tr> + * <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + * <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + * <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + * <tr><td> 422 </td><td> The server cannot process the request because it contains invalid data. </td><td> - </td></tr> + * <tr><td> 429 </td><td> Too many requests </td><td> - </td></tr> + * </table> + */ + public ApiResponse<MuteRuleResponse> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateMuteRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<MuteRuleResponse>() {}); + } + + /** + * Update a mute rule. + * + * <p>See {@link #updateMuteRuleWithHttpInfo}. + * + * @param muteRuleId ID of the mute rule (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> + */ + public CompletableFuture<ApiResponse<MuteRuleResponse>> updateMuteRuleWithHttpInfoAsync( + UUID muteRuleId, UpdateMuteRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'muteRuleId' is set + if (muteRuleId == null) { + CompletableFuture<ApiResponse<MuteRuleResponse>> 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<ApiResponse<MuteRuleResponse>> 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<String, String> localVarHeaderParams = new HashMap<String, String>(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.updateMuteRule", + localVarPath, + new ArrayList<Pair>(), + localVarHeaderParams, + new HashMap<String, String>(), + new String[] {"application/json"}, + new String[] {"AuthZ", "apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture<ApiResponse<MuteRuleResponse>> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap<String, Object>(), + false, + new GenericType<MuteRuleResponse>() {}); + } + /** * 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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/AutomationRule.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRule.java new file mode 100644 index 00000000000..3d68b7a7aa2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRule.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({ + AutomationRule.JSON_PROPERTY_ISSUE_TYPE, + AutomationRule.JSON_PROPERTY_QUERY, + AutomationRule.JSON_PROPERTY_RULE_IDS, + AutomationRule.JSON_PROPERTY_RULE_TYPES, + AutomationRule.JSON_PROPERTY_SEVERITIES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRule { + @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<String> ruleIds = null; + + public static final String JSON_PROPERTY_RULE_TYPES = "rule_types"; + private List<SecurityRuleTypesItems> ruleTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_SEVERITIES = "severities"; + private List<SecurityRuleSeverity> severities = null; + + public AutomationRule() {} + + @JsonCreator + public AutomationRule( + @JsonProperty(required = true, value = JSON_PROPERTY_ISSUE_TYPE) IssueType issueType, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE_TYPES) + List<SecurityRuleTypesItems> ruleTypes) { + this.issueType = issueType; + this.unparsed |= !issueType.isValid(); + this.ruleTypes = ruleTypes; + } + + public AutomationRule 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 AutomationRule 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 AutomationRule ruleIds(List<String> ruleIds) { + this.ruleIds = ruleIds; + return this; + } + + public AutomationRule 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<String> getRuleIds() { + return ruleIds; + } + + public void setRuleIds(List<String> ruleIds) { + this.ruleIds = ruleIds; + } + + public AutomationRule ruleTypes(List<SecurityRuleTypesItems> ruleTypes) { + this.ruleTypes = ruleTypes; + return this; + } + + public AutomationRule addRuleTypesItem(SecurityRuleTypesItems 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<SecurityRuleTypesItems> getRuleTypes() { + return ruleTypes; + } + + public void setRuleTypes(List<SecurityRuleTypesItems> ruleTypes) { + this.ruleTypes = ruleTypes; + } + + public AutomationRule severities(List<SecurityRuleSeverity> severities) { + this.severities = severities; + return this; + } + + public AutomationRule addSeveritiesItem(SecurityRuleSeverity 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<SecurityRuleSeverity> getSeverities() { + return severities; + } + + public void setSeverities(List<SecurityRuleSeverity> 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<String, Object> 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 AutomationRule + */ + @JsonAnySetter + public AutomationRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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 AutomationRule object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRule automationRule = (AutomationRule) o; + return Objects.equals(this.issueType, automationRule.issueType) + && Objects.equals(this.query, automationRule.query) + && Objects.equals(this.ruleIds, automationRule.ruleIds) + && Objects.equals(this.ruleTypes, automationRule.ruleTypes) + && Objects.equals(this.severities, automationRule.severities) + && Objects.equals(this.additionalProperties, automationRule.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 AutomationRule {\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/AutomationRuleUser.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleUser.java new file mode 100644 index 00000000000..d9fa3545b63 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleUser.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({AutomationRuleUser.JSON_PROPERTY_HANDLE, AutomationRuleUser.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleUser { + @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 AutomationRuleUser 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 AutomationRuleUser 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<String, Object> 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 AutomationRuleUser + */ + @JsonAnySetter + public AutomationRuleUser putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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 AutomationRuleUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleUser automationRuleUser = (AutomationRuleUser) o; + return Objects.equals(this.handle, automationRuleUser.handle) + && Objects.equals(this.name, automationRuleUser.name) + && Objects.equals(this.additionalProperties, automationRuleUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleUser {\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/CreateInboxRuleParameters.java b/src/main/java/com/datadog/api/client/v2/model/CreateInboxRuleParameters.java new file mode 100644 index 00000000000..856d06d90aa --- /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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..0056f8766d7 --- /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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..de6c3cde437 --- /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 AutomationRule 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) AutomationRule 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(AutomationRule 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 AutomationRule getRule() { + return rule; + } + + public void setRule(AutomationRule 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..151d1eb3e9e --- /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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..aab7c682edc --- /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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..2fada3d4c77 --- /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 AutomationRule 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) AutomationRule 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(AutomationRule 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 AutomationRule getRule() { + return rule; + } + + public void setRule(AutomationRule 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..3d672c9511e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InboxRuleAttributes.java @@ -0,0 +1,361 @@ +/* + * 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 AutomationRuleUser 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 AutomationRuleUser modifiedBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private AutomationRule 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) AutomationRuleUser 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) + AutomationRuleUser modifiedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) AutomationRule 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(AutomationRuleUser 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 AutomationRuleUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(AutomationRuleUser 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(AutomationRuleUser 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 AutomationRuleUser getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(AutomationRuleUser 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(AutomationRule 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 AutomationRule getRule() { + return rule; + } + + public void setRule(AutomationRule 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String> { + + private static final Set<String> allowedValues = + new HashSet<String>(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<InboxRulesType> { + public InboxRulesTypeSerializer(Class<InboxRulesType> 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<String> { + + private static final Set<String> allowedValues = + new HashSet<String>(Arrays.asList("vulnerability")); + + public static final IssueType VULNERABILITY = new IssueType("vulnerability"); + + IssueType(String value) { + super(value, allowedValues); + } + + public static class IssueTypeSerializer extends StdSerializer<IssueType> { + public IssueTypeSerializer(Class<IssueType> 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<String> { + + private static final Set<String> allowedValues = + new HashSet<String>( + 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<MuteReason> { + public MuteReasonSerializer(Class<MuteReason> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..b03e8db7620 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleAttributes.java @@ -0,0 +1,361 @@ +/* + * 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 AutomationRuleUser 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 AutomationRuleUser modifiedBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private AutomationRule 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) AutomationRuleUser 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) + AutomationRuleUser modifiedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) AutomationRule 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(AutomationRuleUser 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 AutomationRuleUser getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(AutomationRuleUser 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(AutomationRuleUser 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 AutomationRuleUser getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(AutomationRuleUser 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(AutomationRule 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 AutomationRule getRule() { + return rule; + } + + public void setRule(AutomationRule 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String> { + + private static final Set<String> allowedValues = new HashSet<String>(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<MuteRulesType> { + public MuteRulesTypeSerializer(Class<MuteRulesType> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..46b8471e57d --- /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 AutomationRule 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(AutomationRule 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 AutomationRule getRule() { + return rule; + } + + public void setRule(AutomationRule 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..613b1820875 --- /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 AutomationRule 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(AutomationRule 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 AutomationRule getRule() { + return rule; + } + + public void setRule(AutomationRule 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..1e82719b23a --- /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, which must 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<ReorderInboxRulesParametersData> data = null; + + public ReorderInboxRulesParameters data(List<ReorderInboxRulesParametersData> 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 <code>ReorderInboxRulesParameters</code> <code>data</code>. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List<ReorderInboxRulesParametersData> getData() { + return data; + } + + public void setData(List<ReorderInboxRulesParametersData> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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..78b1117819f --- /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, which must 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<ReorderMuteRulesParametersData> data = null; + + public ReorderMuteRulesParameters data(List<ReorderMuteRulesParametersData> 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 <code>ReorderMuteRulesParameters</code> <code>data</code>. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List<ReorderMuteRulesParametersData> getData() { + return data; + } + + public void setData(List<ReorderMuteRulesParametersData> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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/SecurityRuleSeverity.java b/src/main/java/com/datadog/api/client/v2/model/SecurityRuleSeverity.java new file mode 100644 index 00000000000..b797b8d3636 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityRuleSeverity.java @@ -0,0 +1,60 @@ +/* + * 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 = SecurityRuleSeverity.SecurityRuleSeveritySerializer.class) +public class SecurityRuleSeverity extends ModelEnum<String> { + + private static final Set<String> allowedValues = + new HashSet<String>(Arrays.asList("critical", "high", "medium", "low", "unknown", "info")); + + public static final SecurityRuleSeverity CRITICAL = new SecurityRuleSeverity("critical"); + public static final SecurityRuleSeverity HIGH = new SecurityRuleSeverity("high"); + public static final SecurityRuleSeverity MEDIUM = new SecurityRuleSeverity("medium"); + public static final SecurityRuleSeverity LOW = new SecurityRuleSeverity("low"); + public static final SecurityRuleSeverity UNKNOWN = new SecurityRuleSeverity("unknown"); + public static final SecurityRuleSeverity INFO = new SecurityRuleSeverity("info"); + + SecurityRuleSeverity(String value) { + super(value, allowedValues); + } + + public static class SecurityRuleSeveritySerializer extends StdSerializer<SecurityRuleSeverity> { + public SecurityRuleSeveritySerializer(Class<SecurityRuleSeverity> t) { + super(t); + } + + public SecurityRuleSeveritySerializer() { + this(null); + } + + @Override + public void serialize( + SecurityRuleSeverity value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SecurityRuleSeverity fromValue(String value) { + return new SecurityRuleSeverity(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SecurityRuleTypesItems.java b/src/main/java/com/datadog/api/client/v2/model/SecurityRuleTypesItems.java new file mode 100644 index 00000000000..ee36bde7a8b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityRuleTypesItems.java @@ -0,0 +1,80 @@ +/* + * 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 = SecurityRuleTypesItems.SecurityRuleTypesItemsSerializer.class) +public class SecurityRuleTypesItems extends ModelEnum<String> { + + private static final Set<String> allowedValues = + new HashSet<String>( + Arrays.asList( + "application_code_vulnerability", + "application_library_vulnerability", + "attack_path", + "container_image_vulnerability", + "host_vulnerability", + "identity_risk", + "misconfiguration", + "api_security")); + + public static final SecurityRuleTypesItems APPLICATION_CODE_VULNERABILITY = + new SecurityRuleTypesItems("application_code_vulnerability"); + public static final SecurityRuleTypesItems APPLICATION_LIBRARY_VULNERABILITY = + new SecurityRuleTypesItems("application_library_vulnerability"); + public static final SecurityRuleTypesItems ATTACK_PATH = + new SecurityRuleTypesItems("attack_path"); + public static final SecurityRuleTypesItems CONTAINER_IMAGE_VULNERABILITY = + new SecurityRuleTypesItems("container_image_vulnerability"); + public static final SecurityRuleTypesItems HOST_VULNERABILITY = + new SecurityRuleTypesItems("host_vulnerability"); + public static final SecurityRuleTypesItems IDENTITY_RISK = + new SecurityRuleTypesItems("identity_risk"); + public static final SecurityRuleTypesItems MISCONFIGURATION = + new SecurityRuleTypesItems("misconfiguration"); + public static final SecurityRuleTypesItems API_SECURITY = + new SecurityRuleTypesItems("api_security"); + + SecurityRuleTypesItems(String value) { + super(value, allowedValues); + } + + public static class SecurityRuleTypesItemsSerializer + extends StdSerializer<SecurityRuleTypesItems> { + public SecurityRuleTypesItemsSerializer(Class<SecurityRuleTypesItems> t) { + super(t); + } + + public SecurityRuleTypesItemsSerializer() { + this(null); + } + + @Override + public void serialize( + SecurityRuleTypesItems value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SecurityRuleTypesItems fromValue(String value) { + return new SecurityRuleTypesItems(value); + } +} 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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<String, Object> 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<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map<String, Object> 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/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..fa7eeec3046 --- /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-28T14:56:16.327Z \ 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..d61ef63614f --- /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\":\"e0e466a5-6a37-4311-85e3-41edcd5bf075\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1738076176650,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076176650,\"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/e0e466a5-6a37-4311-85e3-41edcd5bf075", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "818f451c-634c-0c02-fd61-cfe88c910f0e" + } +] \ 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..cbf80eeb302 --- /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-28T14:56:17.189Z \ 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..1be73b8e9b8 --- /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\":\"84f9054f-4fb3-46a9-a032-2d8d3d6d61dd\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\",\"expire_at\":1893452400000},\"created_at\":1738076177608,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076177608,\"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/84f9054f-4fb3-46a9-a032-2d8d3d6d61dd", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "468d657d-14b7-1b2d-73fa-9c2b09e62024" + } +] \ No newline at end of file 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..8b357295e18 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:56:22.778Z \ 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..ace09a134e1 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Rule_successfully_deleted_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:56:23.246Z \ 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..a263f07686b --- /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-1738076183\",\"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\":\"8b2eba88-d569-457c-a257-81dca506a008\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1738076183701,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076183701,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1738076183\",\"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": "be6c3d9a-37e1-b96c-30ac-4cc25c043d0c" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/8b2eba88-d569-457c-a257-81dca506a008", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1b4aba25-23fc-a2e2-1b99-df2f55a0e6b7" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/8b2eba88-d569-457c-a257-81dca506a008", + "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": "1b4aba25-23fc-a2e2-1b99-df2f55a0e6b8" + } +] \ No newline at end of file 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..d07adb54526 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:56:33.003Z \ 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..861cc179c88 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_an_inbox_rule_returns_Rule_successfully_deleted_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:56:33.378Z \ 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..1c1f48c8ce8 --- /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-1738076193\",\"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\":\"c5278cb5-0b73-4259-a131-f4e39e3ce507\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076193807,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076193807,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1738076193\",\"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": "62bbe91d-02a4-1c44-a776-76b63995c497" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/c5278cb5-0b73-4259-a131-f4e39e3ce507", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9f3ba1d3-0225-711f-7a21-f7251341bd1d" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/c5278cb5-0b73-4259-a131-f4e39e3ce507", + "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": "9f3ba1d3-0225-711f-7a21-f7251341bd1e" + } +] \ 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..e3487da3100 --- /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-28T14:56:44.817Z \ 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..86227f006f2 --- /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-1738076204\",\"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\":\"4c45a22e-76c1-4dd8-b0a4-b759c69f12b5\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1738076205227,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076205227,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1738076204\",\"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": "ac943bf0-6559-3dd8-53f9-4ef61a37c545" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/4c45a22e-76c1-4dd8-b0a4-b759c69f12b5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"4c45a22e-76c1-4dd8-b0a4-b759c69f12b5\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1738076205227,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076205227,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1738076204\",\"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": "27250497-fb0d-aa06-cd19-32e78af65760" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/4c45a22e-76c1-4dd8-b0a4-b759c69f12b5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9764f504-97bf-11cb-76ff-d17c2daf0fd7" + } +] \ 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..8960e1e1843 --- /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-28T14:56:46.132Z \ 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_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..40f13f871e5 --- /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-28T14:56:50.068Z \ 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..1fb8d40809d --- /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-1738076210\",\"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\":\"0d3e2f13-ffda-4802-aec8-1c0a4936dc23\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076210476,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076210476,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1738076210\",\"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": "2c2376fe-e744-999e-3b67-8e13c59f47bd" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/0d3e2f13-ffda-4802-aec8-1c0a4936dc23", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"0d3e2f13-ffda-4802-aec8-1c0a4936dc23\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076210476,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076210476,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1738076210\",\"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": "a7c83922-3721-2d5a-4ef4-84d822cfe85f" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/0d3e2f13-ffda-4802-aec8-1c0a4936dc23", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "97a56c48-7571-2478-8c00-28d1baedab4a" + } +] \ 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..46e326e8e75 --- /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-28T14:56:51.376Z \ 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..3bd78eb9f80 --- /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-28T14:56:54.480Z \ 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..dc0653aa579 --- /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-1738076214\",\"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\":\"1b5ede63-c593-4408-a54c-dc8418d36a50\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076214890,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076214890,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1738076214\",\"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": "5fc34dff-9d85-2300-1b29-f611c0e9e5c7" + }, + { + "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\":\"1b5ede63-c593-4408-a54c-dc8418d36a50\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076214890,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076214890,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1738076214\",\"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/1b5ede63-c593-4408-a54c-dc8418d36a50", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c04c8bbe-d1c6-ca0e-e24f-4361b3157b1d" + } +] \ 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..4b6e550c322 --- /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-28T14:56:56.037Z \ 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..d5eb8b316fd --- /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-1738076216\",\"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\":\"781a0ca4-a262-4390-80ae-50a5ea91c59b\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1738076216450,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076216450,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1738076216\",\"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": "637aca91-18cc-9c0c-d545-0a8567e78680" + }, + { + "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\":\"781a0ca4-a262-4390-80ae-50a5ea91c59b\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1738076216450,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076216450,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1738076216\",\"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/781a0ca4-a262-4390-80ae-50a5ea91c59b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9dd72b24-4c0a-a69f-b8fa-73e29800650f" + } +] \ 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..022691fea81 --- /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-28T14:57:02.493Z \ 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..197ba8bb957 --- /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-1738076222\",\"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\":\"d7a109ad-032f-4f25-b80c-de7fef3f7b94\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1738076222803,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076222803,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1738076222\",\"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": "dfb64d85-afdf-98f0-6fc7-698ed7a0b6d4" + }, + { + "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\":\"d7a109ad-032f-4f25-b80c-de7fef3f7b94\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/d7a109ad-032f-4f25-b80c-de7fef3f7b94", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"d7a109ad-032f-4f25-b80c-de7fef3f7b94\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\",\"expire_at\":1893452400000},\"created_at\":1738076222803,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076223290,\"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": "d902280f-4b75-2d26-21e9-76879bb6af9f" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/d7a109ad-032f-4f25-b80c-de7fef3f7b94", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5a351265-dd42-e9d8-5ef7-5ac5dbba0d31" + } +] \ 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..f3a77648835 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_a_mute_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:57:03.825Z \ 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_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..9ddcd4054f4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:57:10.433Z \ 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..afd09dc7f0f --- /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-1738076230\",\"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\":\"7fffd998-9474-451a-b750-a306120b5fe7\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076230847,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076230847,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Patch_an_inbox_rule_returns_Bad_Request_response-1738076230\",\"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": "9110d86a-7df0-7b09-6cf3-75532b10f997" + }, + { + "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\":\"7fffd998-9474-451a-b750-a306120b5fe7\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/7fffd998-9474-451a-b750-a306120b5fe7", + "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": "cd4edd48-fb45-3d3b-1353-c7f60701c4e0" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/7fffd998-9474-451a-b750-a306120b5fe7", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "47c20ad4-8141-0376-66ca-0ed439a9c170" + } +] \ 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..0b9ed6f52cc --- /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-28T14:57:11.757Z \ 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..14e5dfc0ef0 --- /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-1738076231\",\"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\":\"b1cae592-90ba-424c-8398-1d0e2f4a4689\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076232178,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076232178,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1738076231\",\"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": "2a2fb93f-d470-b151-f030-6cb090c9b2af" + }, + { + "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\":\"b1cae592-90ba-424c-8398-1d0e2f4a4689\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PATCH", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/b1cae592-90ba-424c-8398-1d0e2f4a4689", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b1cae592-90ba-424c-8398-1d0e2f4a4689\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1738076232178,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076232662,\"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": "13cb23bc-916c-c5c8-aae5-14aaee153cad" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/b1cae592-90ba-424c-8398-1d0e2f4a4689", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "799ed776-bb26-cd5c-b9d9-74036798e95d" + } +] \ 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..f2582e8b230 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Patch_an_inbox_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:57:13.093Z \ 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/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..61e377441dc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:57:17.105Z \ 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..b88576b1ba8 --- /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-1738076237\",\"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\":\"c3ea4deb-588b-4340-874c-6ed929273635\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1738076237517,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076237517,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_a_mute_rule_returns_Bad_Request_response-1738076237\",\"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": "29b8986f-d2f5-1b79-d1f5-3001843ccd5b" + }, + { + "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\":\"c3ea4deb-588b-4340-874c-6ed929273635\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/c3ea4deb-588b-4340-874c-6ed929273635", + "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": "ac815f02-da53-7a66-3d4d-53efaa47a9af" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/c3ea4deb-588b-4340-874c-6ed929273635", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "affbd9c9-7cd2-7495-eed3-64039b32a73a" + } +] \ 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..6d09d070e0c --- /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-28T14:57:18.388Z \ 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..5d32be6053d --- /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-1738076238\",\"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\":\"edf96f66-5f69-4d05-a027-4157260b2bb7\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1738076238794,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076238794,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1738076238\",\"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": "34be40b4-9567-c72a-812e-780fdc16d8c4" + }, + { + "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\":\"edf96f66-5f69-4d05-a027-4157260b2bb7\",\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/edf96f66-5f69-4d05-a027-4157260b2bb7", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"edf96f66-5f69-4d05-a027-4157260b2bb7\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\",\"reason_description\":\"Muting for a while\",\"expire_at\":1893452400000},\"created_at\":1738076238794,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076239278,\"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": "ae229316-b574-a7ca-fa47-847d85907808" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/edf96f66-5f69-4d05-a027-4157260b2bb7", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3b797afb-469d-c13a-6007-875b92ea99c2" + } +] \ 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..277ceb52d21 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:57:19.708Z \ 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..9ee63a2d984 --- /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-28T14:57:20.205Z \ 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..03a4a08362d --- /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-1738076240\",\"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\":\"dd1f2131-9b79-4510-a18b-523bc53158bb\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"duplicate\"},\"created_at\":1738076240624,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076240624,\"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-1738076240\",\"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": "6f5b0c57-0305-1073-25cc-adfc5d982332" + }, + { + "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/dd1f2131-9b79-4510-a18b-523bc53158bb", + "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": "09718577-bb69-c4ac-4328-e9e0b146336b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/mute_rules/dd1f2131-9b79-4510-a18b-523bc53158bb", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "815301da-b473-6f88-0b36-51aa7a6a13de" + } +] \ No newline at end of file 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..17d150b9401 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:57:27.999Z \ 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..0e9dfd880db --- /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-1738076247\",\"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\":\"2304d942-bdea-4c7e-9899-2f5882eba53a\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076248310,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076248310,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_an_inbox_rule_returns_Bad_Request_response-1738076247\",\"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": "a56f618e-7cdd-e5d5-a3af-75c24887d577" + }, + { + "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\":\"2304d942-bdea-4c7e-9899-2f5882eba53a\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/2304d942-bdea-4c7e-9899-2f5882eba53a", + "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": "bfe36686-faf7-c2c9-d527-9114050f57d9" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/2304d942-bdea-4c7e-9899-2f5882eba53a", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ec49dc33-e933-c55e-3e14-fb6cf12e8dcd" + } +] \ 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..3d40712bb9e --- /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-28T14:57:29.306Z \ 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..8708e5ef5f0 --- /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-1738076249\",\"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\":\"a4b6b6fd-641c-4633-b6b0-cc53fde68159\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076249602,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076249602,\"modified_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"name\":\"Test-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1738076249\",\"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": "4ad36ac1-9d34-def0-0bc9-61a6afdd84b4" + }, + { + "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\":\"a4b6b6fd-641c-4633-b6b0-cc53fde68159\",\"type\":\"inbox_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/a4b6b6fd-641c-4633-b6b0-cc53fde68159", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"a4b6b6fd-641c-4633-b6b0-cc53fde68159\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"We want to focus on these items.\"},\"created_at\":1738076249602,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076250066,\"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": "1c0b131a-e397-f226-3308-100b789d783b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/a4b6b6fd-641c-4633-b6b0-cc53fde68159", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "bb9aa144-5a97-9986-5d39-67e47356ebae" + } +] \ 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..525ddb90fbb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_an_inbox_rule_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2025-01-28T14:57:30.606Z \ 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..74aa9ac75b8 --- /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-28T14:57:30.963Z \ 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..e1fbe84c314 --- /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_-1738076250\",\"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\":\"faae7573-c106-4d14-8dbc-585e003f51c1\",\"type\":\"inbox_rules\",\"attributes\":{\"action\":{\"reason_description\":\"items to focus on\"},\"created_at\":1738076251372,\"created_by\":{\"name\":\"frog\",\"handle\":\"frog@datadoghq.com\"},\"enabled\":true,\"modified_at\":1738076251372,\"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_-1738076250\",\"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": "8f61b897-3c49-3526-8d33-939611aa35c9" + }, + { + "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/faae7573-c106-4d14-8dbc-585e003f51c1", + "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": "d227dcf4-137c-f15a-1bbf-bc24a76f61f9" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/vulnerabilities/pipelines/inbox_rules/faae7573-c106-4d14-8dbc-585e003f51c1", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "df5c4717-d504-5cc2-c5c1-75fde04fdcca" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/given.json b/src/test/resources/com/datadog/api/client/v2/api/given.json index 9f928a1afcb..3c7c1e57e3d 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 @@ -571,6 +571,30 @@ "tag": "Security Monitoring", "operationId": "CreateVulnerabilityNotificationRule" }, + { + "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 a82f2a3dcd8..e42eb9ca820 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 + @generated @skip @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"]}}, "type": "inbox_rules"}} + 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 + + @generated @skip @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"]}}, "type": "mute_rules"}} + 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/cloud-security-posture-management Scenario: Create a new signal-based rule returns "Bad Request" response Given new "CreateSignalNotificationRule" request @@ -324,6 +352,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 @@ -445,6 +488,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 @@ -657,6 +715,29 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @skip @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Bad Request" 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 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 + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get details of a signal-based rule returns "Bad Request" response Given new "GetSignalNotificationRule" request @@ -701,6 +782,29 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 Notification rule details. + @skip @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Bad Request" 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 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 list of signal-based rules returns "The list of notification rules." response Given there is a valid "valid_signal_notification_rule" in the system @@ -715,6 +819,20 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 The list of notification rules. + @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 @@ -889,6 +1007,41 @@ 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 + + @skip @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 a signal-based rule returns "Bad Request" response Given new "PatchSignalNotificationRule" request @@ -957,6 +1110,69 @@ Feature: Security Monitoring 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 + + @skip @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 @@ -1038,6 +1254,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 @@ -1138,6 +1389,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 bb873597555..778d245019d 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 @@ -2147,6 +2147,104 @@ "type": "idempotent" } }, + "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": {