diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b17c8433bd5..de1bbc1393c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11426,6 +11426,16 @@ components: x-enum-varnames: - EXECUTE_WORKFLOW - ASSIGN_AGENT + AutomationRuleActorType: + description: Whether the actor is a user or the Datadog system. + enum: + - user + - system + example: user + type: string + x-enum-varnames: + - USER + - SYSTEM AutomationRuleAttributes: description: Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state. properties: @@ -11494,6 +11504,42 @@ components: required: - data type: object + AutomationRuleCreatedBy: + description: The user or Datadog system who created the rule. + properties: + id: + description: The actor's identifier (a user UUID or a system identifier). + example: "00000000-0000-0000-0000-000000000000" + type: string + name: + description: The name of the actor. + example: "Jane Doe" + type: string + type: + $ref: "#/components/schemas/AutomationRuleActorType" + required: + - type + - id + - name + type: object + AutomationRuleModifiedBy: + description: The user or Datadog system who last modified the rule. + properties: + id: + description: The actor's identifier (a user UUID or a system identifier). + example: "00000000-0000-0000-0000-000000000000" + type: string + name: + description: The name of the actor. + example: "Jane Doe" + type: string + type: + $ref: "#/components/schemas/AutomationRuleActorType" + required: + - type + - id + - name + type: object AutomationRuleRelationships: description: Related resources for the automation rule, including the users who created and last modified it. properties: @@ -11510,6 +11556,19 @@ components: required: - data type: object + AutomationRuleScope: + description: Defines the scope of findings to which the automation rule applies. + properties: + finding_types: + $ref: "#/components/schemas/SecurityFindingTypes" + query: + description: A search query to further filter the findings matched by this rule. The `@workflow.*` namespace and `@status` fields are not permitted. For a reference of available fields, see the [Security Findings schema documentation](https://docs.datadoghq.com/security/guide/findings-schema/). + example: "env:prod team:platform" + maxLength: 30000 + type: string + required: + - finding_types + type: object AutomationRuleTrigger: description: Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires). properties: @@ -31697,6 +31756,242 @@ components: - type - attributes type: object + DueDateFrom: + description: The reference point from which the due date is calculated. When `fix_available` is selected but not applicable to the finding type, `first_seen` is used instead. + enum: + - first_seen + - fix_available + example: first_seen + type: string + x-enum-varnames: + - FIRST_SEEN + - FIX_AVAILABLE + DueDatePerSeverityItem: + description: A mapping of a severity level to the number of days until a finding is due. + properties: + due_in_days: + description: The number of days from the reference point until the finding is due. + example: 7 + format: int64 + maximum: 365 + minimum: 1 + type: integer + severity: + $ref: "#/components/schemas/DueDateSeverity" + required: + - severity + - due_in_days + type: object + DueDatePerSeverityList: + description: A list of severity-to-due-date mappings. Each severity may appear at most once. + items: + $ref: "#/components/schemas/DueDatePerSeverityItem" + type: array + DueDateRuleAction: + description: The action to take when the due date rule matches a finding. + properties: + due_days_per_severity: + $ref: "#/components/schemas/DueDatePerSeverityList" + due_from: + $ref: "#/components/schemas/DueDateFrom" + reason_description: + description: An optional description providing more context for the due date assignment. + example: "Applied for production findings only" + maxLength: 20000 + type: string + required: + - due_days_per_severity + - due_from + type: object + DueDateRuleAttributesCreate: + description: Attributes for creating or updating a due date rule. + properties: + action: + $ref: "#/components/schemas/DueDateRuleAction" + enabled: + description: Whether the due date rule is enabled. + example: true + type: boolean + name: + description: The name of the due date rule. + example: "Critical findings due in 7 days" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + DueDateRuleAttributesResponse: + description: Attributes of a due date rule returned by the API. + properties: + action: + $ref: "#/components/schemas/DueDateRuleAction" + created_at: + description: The Unix timestamp in milliseconds when the rule was created. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the due date rule is enabled. + example: true + type: boolean + modified_at: + description: The Unix timestamp in milliseconds when the rule was last modified. + example: 1722439510282 + format: int64 + type: integer + modified_by: + $ref: "#/components/schemas/AutomationRuleModifiedBy" + name: + description: The name of the due date rule. + example: "Critical findings due in 7 days" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - enabled + - rule + - action + - created_at + - created_by + - modified_at + - modified_by + type: object + DueDateRuleCreateRequest: + description: The body of a due date rule create request. + properties: + data: + $ref: "#/components/schemas/DueDateRuleDataCreate" + required: + - data + type: object + DueDateRuleDataCreate: + description: The data object for a due date rule create or update request. + properties: + attributes: + $ref: "#/components/schemas/DueDateRuleAttributesCreate" + type: + $ref: "#/components/schemas/DueDateRuleType" + required: + - type + - attributes + type: object + DueDateRuleDataResponse: + description: The data object for a due date rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/DueDateRuleAttributesResponse" + id: + description: The ID of the due date rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/DueDateRuleType" + required: + - id + - type + - attributes + type: object + DueDateRuleReorderData: + description: The ordered list of all due date rules; every rule must be included. + items: + $ref: "#/components/schemas/DueDateRuleReorderItem" + type: array + DueDateRuleReorderItem: + description: A reference to a due date rule used for reordering. + properties: + id: + description: The ID of the automation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/DueDateRuleType" + required: + - type + - id + type: object + DueDateRuleReorderRequest: + description: The body of the due date rule reorder request. + properties: + data: + $ref: "#/components/schemas/DueDateRuleReorderData" + required: + - data + type: object + DueDateRuleResponse: + description: A single due date rule response. + properties: + data: + $ref: "#/components/schemas/DueDateRuleDataResponse" + required: + - data + type: object + DueDateRuleType: + description: The JSON:API type for due date rules. + enum: + - due_date_rules + example: due_date_rules + type: string + x-enum-varnames: + - DUE_DATE_RULES + DueDateRuleUpdateRequest: + description: The body of a due date rule update request. + properties: + data: + $ref: "#/components/schemas/DueDateRuleDataCreate" + required: + - data + type: object + DueDateRulesDataList: + description: A list of due date rule data objects. + items: + $ref: "#/components/schemas/DueDateRuleDataResponse" + type: array + DueDateRulesResponse: + description: A list of due date rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/DueDateRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object + DueDateSeverity: + description: A severity level used to configure due date thresholds. + enum: + - critical + - high + - medium + - low + - info + - none + - unknown + example: critical + type: string + x-enum-varnames: + - CRITICAL + - HIGH + - MEDIUM + - LOW + - INFO + - NONE + - UNKNOWN ELFSourcemapAttributes: description: Attributes of an ELF symbol file. properties: @@ -61121,6 +61416,211 @@ components: - type - id type: object + MuteReason: + description: The reason for muting a security finding. + enum: + - duplicate + - false_positive + - no_fix + - other + - pending_fix + - risk_accepted + example: risk_accepted + type: string + x-enum-varnames: + - DUPLICATE + - FALSE_POSITIVE + - NO_FIX + - OTHER + - PENDING_FIX + - RISK_ACCEPTED + MuteRuleAction: + description: The action to take when the mute rule matches a finding. + properties: + expire_at: + description: The Unix timestamp in milliseconds at which the mute expires. If omitted, the mute does not expire. + example: 4070908800000 + format: int64 + type: integer + reason: + $ref: "#/components/schemas/MuteReason" + reason_description: + description: An optional description providing more context for the mute reason. + example: "Accepted for dev environments only" + maxLength: 20000 + type: string + required: + - reason + type: object + MuteRuleAttributesCreate: + description: Attributes for creating or updating a mute rule. + properties: + action: + $ref: "#/components/schemas/MuteRuleAction" + enabled: + description: Whether the mute rule is enabled. + example: true + type: boolean + name: + description: The name of the mute rule. + example: "Mute accepted risks in dev" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + MuteRuleAttributesResponse: + description: Attributes of a mute rule returned by the API. + properties: + action: + $ref: "#/components/schemas/MuteRuleAction" + created_at: + description: The Unix timestamp in milliseconds when the rule was created. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the mute rule is enabled. + example: true + type: boolean + modified_at: + description: The Unix timestamp in milliseconds when the rule was last modified. + example: 1722439510282 + format: int64 + type: integer + modified_by: + $ref: "#/components/schemas/AutomationRuleModifiedBy" + name: + description: The name of the mute rule. + example: "Mute accepted risks in dev" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - enabled + - rule + - action + - created_at + - created_by + - modified_at + - modified_by + type: object + MuteRuleCreateRequest: + description: The body of a mute rule create request. + properties: + data: + $ref: "#/components/schemas/MuteRuleDataCreate" + required: + - data + type: object + MuteRuleDataCreate: + description: The data object for a mute rule create or update request. + properties: + attributes: + $ref: "#/components/schemas/MuteRuleAttributesCreate" + type: + $ref: "#/components/schemas/MuteRuleType" + required: + - type + - attributes + type: object + MuteRuleDataResponse: + description: The data object for a mute rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/MuteRuleAttributesResponse" + id: + description: The ID of the mute rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/MuteRuleType" + required: + - id + - type + - attributes + type: object + MuteRuleReorderData: + description: The ordered list of all mute rules; every rule must be included. + items: + $ref: "#/components/schemas/MuteRuleReorderItem" + type: array + MuteRuleReorderItem: + description: A reference to a mute rule used for reordering. + properties: + id: + description: The ID of the automation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/MuteRuleType" + required: + - type + - id + type: object + MuteRuleReorderRequest: + description: The body of the mute rule reorder request. + properties: + data: + $ref: "#/components/schemas/MuteRuleReorderData" + required: + - data + type: object + MuteRuleResponse: + description: A single mute rule response. + properties: + data: + $ref: "#/components/schemas/MuteRuleDataResponse" + required: + - data + type: object + MuteRuleType: + description: The JSON:API type for mute rules. + enum: + - mute_rules + example: mute_rules + type: string + x-enum-varnames: + - MUTE_RULES + MuteRuleUpdateRequest: + description: The body of a mute rule update request. + properties: + data: + $ref: "#/components/schemas/MuteRuleDataCreate" + required: + - data + type: object + MuteRulesDataList: + description: A list of mute rule data objects. + items: + $ref: "#/components/schemas/MuteRuleDataResponse" + type: array + MuteRulesResponse: + description: A list of mute rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/MuteRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object NDKSourcemapAttributes: description: Attributes of an Android NDK symbol file. properties: @@ -82773,6 +83273,48 @@ components: - SYSTEM - LIGHT - DARK + SecurityAutomationRulesLinks: + description: Pagination links for the list of automation rules. + properties: + first: + description: Link to the first page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=0" + type: string + last: + description: Link to the last page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=5" + type: string + next: + description: Link to the next page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=2" + type: string + prev: + description: Link to the previous page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=0" + type: string + required: + - first + - last + type: object + SecurityAutomationRulesMeta: + description: Metadata for the list of automation rules. + properties: + page: + $ref: "#/components/schemas/SecurityAutomationRulesPageInfo" + required: + - page + type: object + SecurityAutomationRulesPageInfo: + description: Pagination information for the list of automation rules. + properties: + total_filtered_count: + description: The total number of rules matching the current filter. + example: 42 + format: int64 + type: integer + required: + - total_filtered_count + type: object SecurityEntityConfigRisks: description: Configuration risks associated with the entity properties: @@ -83377,6 +83919,42 @@ components: meta: $ref: "#/components/schemas/SecurityFilterMeta" type: object + SecurityFindingType: + description: The type of security finding that the automation rule applies to. + enum: + - api_security + - attack_path + - host_and_container_vulnerability + - iac_misconfiguration + - identity_risk + - library_vulnerability + - misconfiguration + - runtime_code_vulnerability + - secret + - static_code_vulnerability + - workload_activity + example: misconfiguration + type: string + x-enum-varnames: + - API_SECURITY + - ATTACK_PATH + - HOST_AND_CONTAINER_VULNERABILITY + - IAC_MISCONFIGURATION + - IDENTITY_RISK + - LIBRARY_VULNERABILITY + - MISCONFIGURATION + - RUNTIME_CODE_VULNERABILITY + - SECRET + - STATIC_CODE_VULNERABILITY + - WORKLOAD_ACTIVITY + SecurityFindingTypes: + description: The list of security finding types that the automation rule applies to. + example: + - misconfiguration + items: + $ref: "#/components/schemas/SecurityFindingType" + minItems: 1 + type: array SecurityFindingsAttributes: description: The JSON object containing all attributes of the security finding. properties: @@ -101859,6 +102437,255 @@ components: type: string x-enum-varnames: - TEST_OPTIMIZATION_UPDATE_SERVICE_SETTINGS_REQUEST + TicketCreationRuleAction: + description: The action to take when the ticket creation rule matches a finding. + properties: + assignee_id: + description: The UUID of the default assignee for created tickets. + example: "22222222-2222-2222-2222-222222222222" + format: uuid + type: string + fields: + description: Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + example: + labels: + - security + type: object + max_tickets_per_day: + description: The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + example: 100 + format: int64 + maximum: 500 + minimum: 1 + type: integer + project_id: + description: The UUID of the case management project. + example: "11111111-1111-1111-1111-111111111111" + format: uuid + type: string + target: + $ref: "#/components/schemas/TicketCreationTarget" + required: + - project_id + - target + - max_tickets_per_day + type: object + TicketCreationRuleActionResponse: + description: The action to take when the ticket creation rule matches a finding. + properties: + assignee_id: + description: The UUID of the default assignee for created tickets. + example: "22222222-2222-2222-2222-222222222222" + format: uuid + type: string + auto_disabled_reason: + description: The reason the rule was automatically disabled by the system due to a ticketing integration error. + example: "Daily ticket creation limit exceeded" + type: string + fields: + description: Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + example: + labels: + - security + type: object + max_tickets_per_day: + description: The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + example: 100 + format: int64 + maximum: 500 + minimum: 1 + type: integer + project_id: + description: The UUID of the case management project. + example: "11111111-1111-1111-1111-111111111111" + format: uuid + type: string + target: + $ref: "#/components/schemas/TicketCreationTarget" + required: + - project_id + - target + - max_tickets_per_day + type: object + TicketCreationRuleAttributesCreate: + description: Attributes for creating or updating a ticket creation rule. + properties: + action: + $ref: "#/components/schemas/TicketCreationRuleAction" + enabled: + description: Whether the ticket creation rule is enabled. + example: true + type: boolean + name: + description: The name of the ticket creation rule. + example: "Auto-create Jira tickets for critical findings" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + TicketCreationRuleAttributesResponse: + description: Attributes of a ticket creation rule returned by the API. + properties: + action: + $ref: "#/components/schemas/TicketCreationRuleActionResponse" + created_at: + description: The Unix timestamp in milliseconds when the rule was created. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the ticket creation rule is enabled. + example: true + type: boolean + modified_at: + description: The Unix timestamp in milliseconds when the rule was last modified. + example: 1722439510282 + format: int64 + type: integer + modified_by: + $ref: "#/components/schemas/AutomationRuleModifiedBy" + name: + description: The name of the ticket creation rule. + example: "Auto-create Jira tickets for critical findings" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - enabled + - rule + - action + - created_at + - created_by + - modified_at + - modified_by + type: object + TicketCreationRuleCreateRequest: + description: The body of a ticket creation rule create request. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleDataCreate" + required: + - data + type: object + TicketCreationRuleDataCreate: + description: The data object for a ticket creation rule create or update request. + properties: + attributes: + $ref: "#/components/schemas/TicketCreationRuleAttributesCreate" + type: + $ref: "#/components/schemas/TicketCreationRuleType" + required: + - type + - attributes + type: object + TicketCreationRuleDataResponse: + description: The data object for a ticket creation rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/TicketCreationRuleAttributesResponse" + id: + description: The ID of the ticket creation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/TicketCreationRuleType" + required: + - id + - type + - attributes + type: object + TicketCreationRuleReorderData: + description: The ordered list of all ticket creation rules; every rule must be included. + items: + $ref: "#/components/schemas/TicketCreationRuleReorderItem" + type: array + TicketCreationRuleReorderItem: + description: A reference to a ticket creation rule used for reordering. + properties: + id: + description: The ID of the automation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/TicketCreationRuleType" + required: + - type + - id + type: object + TicketCreationRuleReorderRequest: + description: The body of the ticket creation rule reorder request. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleReorderData" + required: + - data + type: object + TicketCreationRuleResponse: + description: A single ticket creation rule response. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleDataResponse" + required: + - data + type: object + TicketCreationRuleType: + description: The JSON:API type for ticket creation rules. + enum: + - ticket_creation_rules + example: ticket_creation_rules + type: string + x-enum-varnames: + - TICKET_CREATION_RULES + TicketCreationRuleUpdateRequest: + description: The body of a ticket creation rule update request. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleDataCreate" + required: + - data + type: object + TicketCreationRulesDataList: + description: A list of ticket creation rule data objects. + items: + $ref: "#/components/schemas/TicketCreationRuleDataResponse" + type: array + TicketCreationRulesResponse: + description: A list of ticket creation rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/TicketCreationRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object + TicketCreationTarget: + description: The ticketing system to create tickets in. + enum: + - jira + - case_management + example: jira + type: string + x-enum-varnames: + - JIRA + - CASE_MANAGEMENT TimeAggregation: description: |- Time aggregation period (in seconds) is used to aggregate the results of the notification rule evaluation. @@ -167038,6 +167865,1329 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/due_date_rules: + get: + description: Get all due date rules for the current organization. + operationId: ListSecurityFindingsAutomationDueDateRules + parameters: + - description: The number of rules per page. Maximum is 1000. + in: query + name: page[size] + required: false + schema: + default: 1000 + example: 10 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + links: + first: "/api/v2/security/findings/automation/due_date_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/due_date_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/DueDateRulesResponse" + description: Successfully retrieved the list of due date rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all due date rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new due date rule for the current organization. + operationId: CreateSecurityFindingsAutomationDueDateRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + enabled: true + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleResponse" + description: Successfully created the due date rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a due date rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/due_date_rules/reorder: + post: + description: Reorder the list of due date rules for the current organization. + operationId: ReorderSecurityFindingsAutomationDueDateRules + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + - id: "11111111-1111-1111-1111-111111111111" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleReorderRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + - id: "11111111-1111-1111-1111-111111111111" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleReorderRequest" + description: Successfully reordered the due date rules + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Reorder due date rules + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/due_date_rules/{rule_id}: + delete: + description: Delete an existing due date rule by ID. + operationId: DeleteSecurityFindingsAutomationDueDateRule + parameters: + - description: The ID of the due date rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + 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: [] + summary: Delete a due date rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get the details of a due date rule by ID. + operationId: GetSecurityFindingsAutomationDueDateRule + parameters: + - description: The ID of the due date rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleResponse" + description: Successfully retrieved the due date rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a due date rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Update an existing due date rule by ID. + operationId: UpdateSecurityFindingsAutomationDueDateRule + parameters: + - description: The ID of the due date rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + - due_in_days: 90 + severity: medium + due_from: fix_available + enabled: true + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + - due_in_days: 90 + severity: medium + due_from: fix_available + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510999 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleResponse" + description: Successfully updated the due date rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a due date rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/mute_rules: + get: + description: Get all mute rules for the current organization. + operationId: ListSecurityFindingsAutomationMuteRules + parameters: + - description: The number of rules per page. Maximum is 1000. + in: query + name: page[size] + required: false + schema: + default: 1000 + example: 10 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + links: + first: "/api/v2/security/findings/automation/mute_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/mute_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/MuteRulesResponse" + description: Successfully retrieved the list of mute rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all mute rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new mute rule for the current organization. + operationId: CreateSecurityFindingsAutomationMuteRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + enabled: true + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleResponse" + description: Successfully created the mute rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/mute_rules/reorder: + post: + description: Reorder the list of mute rules for the current organization. + operationId: ReorderSecurityFindingsAutomationMuteRules + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + - id: "11111111-1111-1111-1111-111111111111" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleReorderRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + - id: "11111111-1111-1111-1111-111111111111" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleReorderRequest" + description: Successfully reordered the mute rules + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Reorder mute rules + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/mute_rules/{rule_id}: + delete: + description: Delete an existing mute rule by ID. + operationId: DeleteSecurityFindingsAutomationMuteRule + parameters: + - description: The ID of the mute rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + 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: [] + summary: Delete a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get the details of a mute rule by ID. + operationId: GetSecurityFindingsAutomationMuteRule + parameters: + - description: The ID of the mute rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleResponse" + description: Successfully retrieved the mute rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Update an existing mute rule by ID. + operationId: UpdateSecurityFindingsAutomationMuteRule + parameters: + - description: The ID of the mute rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + reason: risk_accepted + enabled: false + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + reason: risk_accepted + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: false + modified_at: 1722439510999 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleResponse" + description: Successfully updated the mute rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/ticket_creation_rules: + get: + description: Get all ticket creation rules for the current organization. + operationId: ListSecurityFindingsAutomationTicketCreationRules + parameters: + - description: The number of rules per page. Maximum is 1000. + in: query + name: page[size] + required: false + schema: + default: 1000 + example: 10 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + links: + first: "/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/TicketCreationRulesResponse" + description: Successfully retrieved the list of ticket creation rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all ticket creation rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new ticket creation rule for the current organization. + operationId: CreateSecurityFindingsAutomationTicketCreationRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + enabled: true + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleResponse" + description: Successfully created the ticket creation rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a ticket creation rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/ticket_creation_rules/reorder: + post: + description: Reorder the list of ticket creation rules for the current organization. + operationId: ReorderSecurityFindingsAutomationTicketCreationRules + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + - id: "11111111-1111-1111-1111-111111111111" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleReorderRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + - id: "11111111-1111-1111-1111-111111111111" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleReorderRequest" + description: Successfully reordered the ticket creation rules + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Reorder ticket creation rules + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/ticket_creation_rules/{rule_id}: + delete: + description: Delete an existing ticket creation rule by ID. + operationId: DeleteSecurityFindingsAutomationTicketCreationRule + parameters: + - description: The ID of the ticket creation rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + 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: [] + summary: Delete a ticket creation rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get the details of a ticket creation rule by ID. + operationId: GetSecurityFindingsAutomationTicketCreationRule + parameters: + - description: The ID of the ticket creation rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleResponse" + description: Successfully retrieved the ticket creation rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a ticket creation rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Update an existing ticket creation rule by ID. + operationId: UpdateSecurityFindingsAutomationTicketCreationRule + parameters: + - description: The ID of the ticket creation rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 50 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + enabled: true + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 50 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510999 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleResponse" + description: Successfully updated the ticket creation rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a ticket creation rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security/findings/cases: delete: description: >- diff --git a/examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.java b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.java new file mode 100644 index 00000000000..ef72b16e638 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.java @@ -0,0 +1,63 @@ +// Create a due date rule returns "Successfully created the due date 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.AutomationRuleScope; +import com.datadog.api.client.v2.model.DueDateFrom; +import com.datadog.api.client.v2.model.DueDatePerSeverityItem; +import com.datadog.api.client.v2.model.DueDateRuleAction; +import com.datadog.api.client.v2.model.DueDateRuleAttributesCreate; +import com.datadog.api.client.v2.model.DueDateRuleCreateRequest; +import com.datadog.api.client.v2.model.DueDateRuleDataCreate; +import com.datadog.api.client.v2.model.DueDateRuleResponse; +import com.datadog.api.client.v2.model.DueDateRuleType; +import com.datadog.api.client.v2.model.DueDateSeverity; +import com.datadog.api.client.v2.model.SecurityFindingType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.createSecurityFindingsAutomationDueDateRule", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + DueDateRuleCreateRequest body = + new DueDateRuleCreateRequest() + .data( + new DueDateRuleDataCreate() + .attributes( + new DueDateRuleAttributesCreate() + .action( + new DueDateRuleAction() + .dueDaysPerSeverity( + Collections.singletonList( + new DueDatePerSeverityItem() + .dueInDays(7L) + .severity(DueDateSeverity.CRITICAL))) + .dueFrom(DueDateFrom.FIRST_SEEN)) + .enabled(true) + .name("Example-Security-Monitoring") + .rule( + new AutomationRuleScope() + .findingTypes( + Collections.singletonList( + SecurityFindingType.MISCONFIGURATION)) + .query("env:staging"))) + .type(DueDateRuleType.DUE_DATE_RULES)); + + try { + DueDateRuleResponse result = apiInstance.createSecurityFindingsAutomationDueDateRule(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#createSecurityFindingsAutomationDueDateRule"); + 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/CreateSecurityFindingsAutomationMuteRule.java b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationMuteRule.java new file mode 100644 index 00000000000..69d228a146d --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationMuteRule.java @@ -0,0 +1,52 @@ +// Create a 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.AutomationRuleScope; +import com.datadog.api.client.v2.model.MuteReason; +import com.datadog.api.client.v2.model.MuteRuleAction; +import com.datadog.api.client.v2.model.MuteRuleAttributesCreate; +import com.datadog.api.client.v2.model.MuteRuleCreateRequest; +import com.datadog.api.client.v2.model.MuteRuleDataCreate; +import com.datadog.api.client.v2.model.MuteRuleResponse; +import com.datadog.api.client.v2.model.MuteRuleType; +import com.datadog.api.client.v2.model.SecurityFindingType; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.createSecurityFindingsAutomationMuteRule", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + MuteRuleCreateRequest body = + new MuteRuleCreateRequest() + .data( + new MuteRuleDataCreate() + .attributes( + new MuteRuleAttributesCreate() + .action(new MuteRuleAction().reason(MuteReason.RISK_ACCEPTED)) + .enabled(true) + .name("Example-Security-Monitoring") + .rule( + new AutomationRuleScope() + .findingTypes( + Collections.singletonList( + SecurityFindingType.MISCONFIGURATION)) + .query("env:staging"))) + .type(MuteRuleType.MUTE_RULES)); + + try { + MuteRuleResponse result = apiInstance.createSecurityFindingsAutomationMuteRule(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling SecurityMonitoringApi#createSecurityFindingsAutomationMuteRule"); + 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/CreateSecurityFindingsAutomationTicketCreationRule.java b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationTicketCreationRule.java new file mode 100644 index 00000000000..f36c0fe0ffa --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationTicketCreationRule.java @@ -0,0 +1,61 @@ +// Create a ticket creation rule returns "Successfully created the ticket creation 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.AutomationRuleScope; +import com.datadog.api.client.v2.model.SecurityFindingType; +import com.datadog.api.client.v2.model.TicketCreationRuleAction; +import com.datadog.api.client.v2.model.TicketCreationRuleAttributesCreate; +import com.datadog.api.client.v2.model.TicketCreationRuleCreateRequest; +import com.datadog.api.client.v2.model.TicketCreationRuleDataCreate; +import com.datadog.api.client.v2.model.TicketCreationRuleResponse; +import com.datadog.api.client.v2.model.TicketCreationRuleType; +import com.datadog.api.client.v2.model.TicketCreationTarget; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.createSecurityFindingsAutomationTicketCreationRule", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + TicketCreationRuleCreateRequest body = + new TicketCreationRuleCreateRequest() + .data( + new TicketCreationRuleDataCreate() + .attributes( + new TicketCreationRuleAttributesCreate() + .action( + new TicketCreationRuleAction() + .maxTicketsPerDay(10L) + .projectId( + UUID.fromString("11111111-1111-1111-1111-111111111111")) + .target(TicketCreationTarget.JIRA)) + .enabled(true) + .name("Example-Security-Monitoring") + .rule( + new AutomationRuleScope() + .findingTypes( + Collections.singletonList( + SecurityFindingType.MISCONFIGURATION)) + .query("env:staging"))) + .type(TicketCreationRuleType.TICKET_CREATION_RULES)); + + try { + TicketCreationRuleResponse result = + apiInstance.createSecurityFindingsAutomationTicketCreationRule(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#createSecurityFindingsAutomationTicketCreationRule"); + 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/DeleteSecurityFindingsAutomationDueDateRule.java b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.java new file mode 100644 index 00000000000..577e197dc5d --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.java @@ -0,0 +1,35 @@ +// Delete a due date 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(); + defaultClient.setUnstableOperationEnabled( + "v2.deleteSecurityFindingsAutomationDueDateRule", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_due_date_rule" in the system + UUID VALID_DUE_DATE_RULE_DATA_ID = null; + try { + VALID_DUE_DATE_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_DUE_DATE_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + apiInstance.deleteSecurityFindingsAutomationDueDateRule(VALID_DUE_DATE_RULE_DATA_ID); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#deleteSecurityFindingsAutomationDueDateRule"); + 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/DeleteSecurityFindingsAutomationMuteRule.java b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.java new file mode 100644 index 00000000000..2d0c9a0eda7 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.java @@ -0,0 +1,33 @@ +// 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(); + defaultClient.setUnstableOperationEnabled("v2.deleteSecurityFindingsAutomationMuteRule", true); + 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.deleteSecurityFindingsAutomationMuteRule(VALID_MUTE_RULE_DATA_ID); + } catch (ApiException e) { + System.err.println( + "Exception when calling SecurityMonitoringApi#deleteSecurityFindingsAutomationMuteRule"); + 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/DeleteSecurityFindingsAutomationTicketCreationRule.java b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.java new file mode 100644 index 00000000000..5730805f321 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.java @@ -0,0 +1,37 @@ +// Delete a ticket creation 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(); + defaultClient.setUnstableOperationEnabled( + "v2.deleteSecurityFindingsAutomationTicketCreationRule", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_ticket_creation_rule" in the system + UUID VALID_TICKET_CREATION_RULE_DATA_ID = null; + try { + VALID_TICKET_CREATION_RULE_DATA_ID = + UUID.fromString(System.getenv("VALID_TICKET_CREATION_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + apiInstance.deleteSecurityFindingsAutomationTicketCreationRule( + VALID_TICKET_CREATION_RULE_DATA_ID); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#deleteSecurityFindingsAutomationTicketCreationRule"); + 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/GetSecurityFindingsAutomationDueDateRule.java b/examples/v2/security-monitoring/GetSecurityFindingsAutomationDueDateRule.java new file mode 100644 index 00000000000..692f9ad2be0 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationDueDateRule.java @@ -0,0 +1,36 @@ +// Get a due date rule returns "Successfully retrieved the due date 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.DueDateRuleResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getSecurityFindingsAutomationDueDateRule", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_due_date_rule" in the system + UUID VALID_DUE_DATE_RULE_DATA_ID = null; + try { + VALID_DUE_DATE_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_DUE_DATE_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + DueDateRuleResponse result = + apiInstance.getSecurityFindingsAutomationDueDateRule(VALID_DUE_DATE_RULE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling SecurityMonitoringApi#getSecurityFindingsAutomationDueDateRule"); + 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/GetSecurityFindingsAutomationMuteRule.java b/examples/v2/security-monitoring/GetSecurityFindingsAutomationMuteRule.java new file mode 100644 index 00000000000..71e45fd3bb5 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationMuteRule.java @@ -0,0 +1,36 @@ +// Get a mute rule returns "Successfully retrieved 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.MuteRuleResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getSecurityFindingsAutomationMuteRule", true); + 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.getSecurityFindingsAutomationMuteRule(VALID_MUTE_RULE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling SecurityMonitoringApi#getSecurityFindingsAutomationMuteRule"); + 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/GetSecurityFindingsAutomationTicketCreationRule.java b/examples/v2/security-monitoring/GetSecurityFindingsAutomationTicketCreationRule.java new file mode 100644 index 00000000000..962a26fab7b --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationTicketCreationRule.java @@ -0,0 +1,40 @@ +// Get a ticket creation rule returns "Successfully retrieved the ticket creation 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.TicketCreationRuleResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.getSecurityFindingsAutomationTicketCreationRule", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_ticket_creation_rule" in the system + UUID VALID_TICKET_CREATION_RULE_DATA_ID = null; + try { + VALID_TICKET_CREATION_RULE_DATA_ID = + UUID.fromString(System.getenv("VALID_TICKET_CREATION_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + try { + TicketCreationRuleResponse result = + apiInstance.getSecurityFindingsAutomationTicketCreationRule( + VALID_TICKET_CREATION_RULE_DATA_ID); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#getSecurityFindingsAutomationTicketCreationRule"); + 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/ListSecurityFindingsAutomationDueDateRules.java b/examples/v2/security-monitoring/ListSecurityFindingsAutomationDueDateRules.java new file mode 100644 index 00000000000..50f47363648 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationDueDateRules.java @@ -0,0 +1,28 @@ +// Get all due date rules returns "Successfully retrieved the list of due date 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.DueDateRulesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.listSecurityFindingsAutomationDueDateRules", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + DueDateRulesResponse result = apiInstance.listSecurityFindingsAutomationDueDateRules(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#listSecurityFindingsAutomationDueDateRules"); + 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/ListSecurityFindingsAutomationMuteRules.java b/examples/v2/security-monitoring/ListSecurityFindingsAutomationMuteRules.java new file mode 100644 index 00000000000..a953c6c9e3c --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationMuteRules.java @@ -0,0 +1,26 @@ +// Get all mute rules returns "Successfully retrieved 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.MuteRulesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listSecurityFindingsAutomationMuteRules", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + MuteRulesResponse result = apiInstance.listSecurityFindingsAutomationMuteRules(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling SecurityMonitoringApi#listSecurityFindingsAutomationMuteRules"); + 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/ListSecurityFindingsAutomationTicketCreationRules.java b/examples/v2/security-monitoring/ListSecurityFindingsAutomationTicketCreationRules.java new file mode 100644 index 00000000000..f198ef6b37b --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationTicketCreationRules.java @@ -0,0 +1,30 @@ +// Get all ticket creation rules returns "Successfully retrieved the list of ticket creation 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.TicketCreationRulesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.listSecurityFindingsAutomationTicketCreationRules", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + TicketCreationRulesResponse result = + apiInstance.listSecurityFindingsAutomationTicketCreationRules(); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#listSecurityFindingsAutomationTicketCreationRules"); + 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/ReorderSecurityFindingsAutomationDueDateRules.java b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationDueDateRules.java new file mode 100644 index 00000000000..e5395658d18 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationDueDateRules.java @@ -0,0 +1,49 @@ +// Reorder due date rules returns "Successfully reordered the due date 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.DueDateRuleReorderItem; +import com.datadog.api.client.v2.model.DueDateRuleReorderRequest; +import com.datadog.api.client.v2.model.DueDateRuleType; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.reorderSecurityFindingsAutomationDueDateRules", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_due_date_rule" in the system + UUID VALID_DUE_DATE_RULE_DATA_ID = null; + try { + VALID_DUE_DATE_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_DUE_DATE_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + DueDateRuleReorderRequest body = + new DueDateRuleReorderRequest() + .data( + Collections.singletonList( + new DueDateRuleReorderItem() + .id(VALID_DUE_DATE_RULE_DATA_ID) + .type(DueDateRuleType.DUE_DATE_RULES))); + + try { + DueDateRuleReorderRequest result = + apiInstance.reorderSecurityFindingsAutomationDueDateRules(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#reorderSecurityFindingsAutomationDueDateRules"); + 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/ReorderSecurityFindingsAutomationMuteRules.java b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationMuteRules.java new file mode 100644 index 00000000000..f9d43f109ce --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationMuteRules.java @@ -0,0 +1,48 @@ +// Reorder mute rules returns "Successfully reordered the 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.MuteRuleReorderItem; +import com.datadog.api.client.v2.model.MuteRuleReorderRequest; +import com.datadog.api.client.v2.model.MuteRuleType; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.reorderSecurityFindingsAutomationMuteRules", true); + 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()); + } + + MuteRuleReorderRequest body = + new MuteRuleReorderRequest() + .data( + Collections.singletonList( + new MuteRuleReorderItem() + .id(VALID_MUTE_RULE_DATA_ID) + .type(MuteRuleType.MUTE_RULES))); + + try { + MuteRuleReorderRequest result = apiInstance.reorderSecurityFindingsAutomationMuteRules(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#reorderSecurityFindingsAutomationMuteRules"); + 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/ReorderSecurityFindingsAutomationTicketCreationRules.java b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationTicketCreationRules.java new file mode 100644 index 00000000000..d88d84e4f71 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationTicketCreationRules.java @@ -0,0 +1,50 @@ +// Reorder ticket creation rules returns "Successfully reordered the ticket creation 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.TicketCreationRuleReorderItem; +import com.datadog.api.client.v2.model.TicketCreationRuleReorderRequest; +import com.datadog.api.client.v2.model.TicketCreationRuleType; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.reorderSecurityFindingsAutomationTicketCreationRules", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_ticket_creation_rule" in the system + UUID VALID_TICKET_CREATION_RULE_DATA_ID = null; + try { + VALID_TICKET_CREATION_RULE_DATA_ID = + UUID.fromString(System.getenv("VALID_TICKET_CREATION_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + TicketCreationRuleReorderRequest body = + new TicketCreationRuleReorderRequest() + .data( + Collections.singletonList( + new TicketCreationRuleReorderItem() + .id(VALID_TICKET_CREATION_RULE_DATA_ID) + .type(TicketCreationRuleType.TICKET_CREATION_RULES))); + + try { + TicketCreationRuleReorderRequest result = + apiInstance.reorderSecurityFindingsAutomationTicketCreationRules(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#reorderSecurityFindingsAutomationTicketCreationRules"); + 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/UpdateSecurityFindingsAutomationDueDateRule.java b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationDueDateRule.java new file mode 100644 index 00000000000..4f049b54d9f --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationDueDateRule.java @@ -0,0 +1,74 @@ +// Update a due date rule returns "Successfully updated the due date 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.AutomationRuleScope; +import com.datadog.api.client.v2.model.DueDateFrom; +import com.datadog.api.client.v2.model.DueDatePerSeverityItem; +import com.datadog.api.client.v2.model.DueDateRuleAction; +import com.datadog.api.client.v2.model.DueDateRuleAttributesCreate; +import com.datadog.api.client.v2.model.DueDateRuleDataCreate; +import com.datadog.api.client.v2.model.DueDateRuleResponse; +import com.datadog.api.client.v2.model.DueDateRuleType; +import com.datadog.api.client.v2.model.DueDateRuleUpdateRequest; +import com.datadog.api.client.v2.model.DueDateSeverity; +import com.datadog.api.client.v2.model.SecurityFindingType; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.updateSecurityFindingsAutomationDueDateRule", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_due_date_rule" in the system + UUID VALID_DUE_DATE_RULE_DATA_ID = null; + try { + VALID_DUE_DATE_RULE_DATA_ID = UUID.fromString(System.getenv("VALID_DUE_DATE_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + DueDateRuleUpdateRequest body = + new DueDateRuleUpdateRequest() + .data( + new DueDateRuleDataCreate() + .attributes( + new DueDateRuleAttributesCreate() + .action( + new DueDateRuleAction() + .dueDaysPerSeverity( + Collections.singletonList( + new DueDatePerSeverityItem() + .dueInDays(14L) + .severity(DueDateSeverity.CRITICAL))) + .dueFrom(DueDateFrom.FIRST_SEEN)) + .enabled(false) + .name("Example-Security-Monitoring") + .rule( + new AutomationRuleScope() + .findingTypes( + Collections.singletonList( + SecurityFindingType.MISCONFIGURATION)) + .query("env:staging"))) + .type(DueDateRuleType.DUE_DATE_RULES)); + + try { + DueDateRuleResponse result = + apiInstance.updateSecurityFindingsAutomationDueDateRule( + VALID_DUE_DATE_RULE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#updateSecurityFindingsAutomationDueDateRule"); + 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/UpdateSecurityFindingsAutomationMuteRule.java b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationMuteRule.java new file mode 100644 index 00000000000..795ab1d554f --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationMuteRule.java @@ -0,0 +1,62 @@ +// Update a mute rule returns "Successfully updated 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.AutomationRuleScope; +import com.datadog.api.client.v2.model.MuteReason; +import com.datadog.api.client.v2.model.MuteRuleAction; +import com.datadog.api.client.v2.model.MuteRuleAttributesCreate; +import com.datadog.api.client.v2.model.MuteRuleDataCreate; +import com.datadog.api.client.v2.model.MuteRuleResponse; +import com.datadog.api.client.v2.model.MuteRuleType; +import com.datadog.api.client.v2.model.MuteRuleUpdateRequest; +import com.datadog.api.client.v2.model.SecurityFindingType; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.updateSecurityFindingsAutomationMuteRule", true); + 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()); + } + + MuteRuleUpdateRequest body = + new MuteRuleUpdateRequest() + .data( + new MuteRuleDataCreate() + .attributes( + new MuteRuleAttributesCreate() + .action(new MuteRuleAction().reason(MuteReason.FALSE_POSITIVE)) + .enabled(false) + .name("Example-Security-Monitoring") + .rule( + new AutomationRuleScope() + .findingTypes( + Collections.singletonList( + SecurityFindingType.MISCONFIGURATION)) + .query("env:staging"))) + .type(MuteRuleType.MUTE_RULES)); + + try { + MuteRuleResponse result = + apiInstance.updateSecurityFindingsAutomationMuteRule(VALID_MUTE_RULE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling SecurityMonitoringApi#updateSecurityFindingsAutomationMuteRule"); + 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/UpdateSecurityFindingsAutomationTicketCreationRule.java b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationTicketCreationRule.java new file mode 100644 index 00000000000..05c03aec86d --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationTicketCreationRule.java @@ -0,0 +1,71 @@ +// Update a ticket creation rule returns "Successfully updated the ticket creation 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.AutomationRuleScope; +import com.datadog.api.client.v2.model.SecurityFindingType; +import com.datadog.api.client.v2.model.TicketCreationRuleAction; +import com.datadog.api.client.v2.model.TicketCreationRuleAttributesCreate; +import com.datadog.api.client.v2.model.TicketCreationRuleDataCreate; +import com.datadog.api.client.v2.model.TicketCreationRuleResponse; +import com.datadog.api.client.v2.model.TicketCreationRuleType; +import com.datadog.api.client.v2.model.TicketCreationRuleUpdateRequest; +import com.datadog.api.client.v2.model.TicketCreationTarget; +import java.util.Collections; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled( + "v2.updateSecurityFindingsAutomationTicketCreationRule", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + // there is a valid "valid_ticket_creation_rule" in the system + UUID VALID_TICKET_CREATION_RULE_DATA_ID = null; + try { + VALID_TICKET_CREATION_RULE_DATA_ID = + UUID.fromString(System.getenv("VALID_TICKET_CREATION_RULE_DATA_ID")); + } catch (IllegalArgumentException e) { + System.err.println("Error parsing UUID: " + e.getMessage()); + } + + TicketCreationRuleUpdateRequest body = + new TicketCreationRuleUpdateRequest() + .data( + new TicketCreationRuleDataCreate() + .attributes( + new TicketCreationRuleAttributesCreate() + .action( + new TicketCreationRuleAction() + .maxTicketsPerDay(5L) + .projectId( + UUID.fromString("11111111-1111-1111-1111-111111111111")) + .target(TicketCreationTarget.JIRA)) + .enabled(false) + .name("Example-Security-Monitoring") + .rule( + new AutomationRuleScope() + .findingTypes( + Collections.singletonList( + SecurityFindingType.MISCONFIGURATION)) + .query("env:staging"))) + .type(TicketCreationRuleType.TICKET_CREATION_RULES)); + + try { + TicketCreationRuleResponse result = + apiInstance.updateSecurityFindingsAutomationTicketCreationRule( + VALID_TICKET_CREATION_RULE_DATA_ID, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println( + "Exception when calling" + + " SecurityMonitoringApi#updateSecurityFindingsAutomationTicketCreationRule"); + 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/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 65f2bb43a0a..eb340ee7ad0 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -912,6 +912,9 @@ public class ApiClient { put("v2.convertSecurityMonitoringTerraformResource", false); put("v2.createIoCTriageState", false); put("v2.createSampleLogGenerationSubscription", false); + put("v2.createSecurityFindingsAutomationDueDateRule", false); + put("v2.createSecurityFindingsAutomationMuteRule", false); + put("v2.createSecurityFindingsAutomationTicketCreationRule", false); put("v2.createSecurityMonitoringDataset", false); put("v2.createSecurityMonitoringIntegrationConfig", false); put("v2.createServiceNowTickets", false); @@ -920,6 +923,9 @@ public class ApiClient { put("v2.deactivateContentPack", false); put("v2.deleteHistoricalJob", false); put("v2.deleteSampleLogGenerationSubscription", false); + put("v2.deleteSecurityFindingsAutomationDueDateRule", false); + put("v2.deleteSecurityFindingsAutomationMuteRule", false); + put("v2.deleteSecurityFindingsAutomationTicketCreationRule", false); put("v2.deleteSecurityMonitoringDataset", false); put("v2.deleteSecurityMonitoringIntegrationConfig", false); put("v2.exportSecurityMonitoringTerraformResource", false); @@ -930,6 +936,9 @@ public class ApiClient { put("v2.getIndicatorOfCompromise", false); put("v2.getRuleVersionHistory", false); put("v2.getSecretsRules", false); + put("v2.getSecurityFindingsAutomationDueDateRule", false); + put("v2.getSecurityFindingsAutomationMuteRule", false); + put("v2.getSecurityFindingsAutomationTicketCreationRule", false); put("v2.getSecurityMonitoringDataset", false); put("v2.getSecurityMonitoringDatasetByVersion", false); put("v2.getSecurityMonitoringDatasetVersionHistory", false); @@ -948,16 +957,25 @@ public class ApiClient { put("v2.listMultipleRulesets", false); put("v2.listSampleLogGenerationSubscriptions", false); put("v2.listScannedAssetsMetadata", false); + put("v2.listSecurityFindingsAutomationDueDateRules", false); + put("v2.listSecurityFindingsAutomationMuteRules", false); + put("v2.listSecurityFindingsAutomationTicketCreationRules", false); put("v2.listSecurityMonitoringDatasets", false); put("v2.listSecurityMonitoringHistsignals", false); put("v2.listSecurityMonitoringIntegrationConfigs", false); put("v2.listStaticAnalysisCodegenRulesets", false); put("v2.listVulnerabilities", false); put("v2.listVulnerableAssets", false); + put("v2.reorderSecurityFindingsAutomationDueDateRules", false); + put("v2.reorderSecurityFindingsAutomationMuteRules", false); + put("v2.reorderSecurityFindingsAutomationTicketCreationRules", false); put("v2.restoreSecurityMonitoringRule", false); put("v2.runHistoricalJob", false); put("v2.searchSecurityMonitoringHistsignals", false); put("v2.updateFindingsAssignee", false); + put("v2.updateSecurityFindingsAutomationDueDateRule", false); + put("v2.updateSecurityFindingsAutomationMuteRule", false); + put("v2.updateSecurityFindingsAutomationTicketCreationRule", false); put("v2.updateSecurityMonitoringDataset", false); put("v2.updateSecurityMonitoringIntegrationConfig", false); put("v2.validateSecurityMonitoringIntegrationConfig", false); 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 8d03af23515..2527dd9702e 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 @@ -24,6 +24,11 @@ import com.datadog.api.client.v2.model.DefaultRulesetsPerLanguageResponse; import com.datadog.api.client.v2.model.DeleteCustomFrameworkResponse; import com.datadog.api.client.v2.model.DetachCaseRequest; +import com.datadog.api.client.v2.model.DueDateRuleCreateRequest; +import com.datadog.api.client.v2.model.DueDateRuleReorderRequest; +import com.datadog.api.client.v2.model.DueDateRuleResponse; +import com.datadog.api.client.v2.model.DueDateRuleUpdateRequest; +import com.datadog.api.client.v2.model.DueDateRulesResponse; import com.datadog.api.client.v2.model.EntityContextResponse; import com.datadog.api.client.v2.model.Finding; import com.datadog.api.client.v2.model.FindingCaseResponse; @@ -56,6 +61,11 @@ import com.datadog.api.client.v2.model.ListVulnerableAssetsResponse; import com.datadog.api.client.v2.model.MuteFindingsRequest; import com.datadog.api.client.v2.model.MuteFindingsResponse; +import com.datadog.api.client.v2.model.MuteRuleCreateRequest; +import com.datadog.api.client.v2.model.MuteRuleReorderRequest; +import com.datadog.api.client.v2.model.MuteRuleResponse; +import com.datadog.api.client.v2.model.MuteRuleUpdateRequest; +import com.datadog.api.client.v2.model.MuteRulesResponse; import com.datadog.api.client.v2.model.NodeTypesResponse; import com.datadog.api.client.v2.model.NotificationRulePreviewResponse; import com.datadog.api.client.v2.model.NotificationRuleResponse; @@ -146,6 +156,11 @@ import com.datadog.api.client.v2.model.SecurityMonitoringTerraformResourceType; import com.datadog.api.client.v2.model.SignalEntitiesResponse; import com.datadog.api.client.v2.model.SingleEntityContextResponse; +import com.datadog.api.client.v2.model.TicketCreationRuleCreateRequest; +import com.datadog.api.client.v2.model.TicketCreationRuleReorderRequest; +import com.datadog.api.client.v2.model.TicketCreationRuleResponse; +import com.datadog.api.client.v2.model.TicketCreationRuleUpdateRequest; +import com.datadog.api.client.v2.model.TicketCreationRulesResponse; import com.datadog.api.client.v2.model.UpdateCustomFrameworkRequest; import com.datadog.api.client.v2.model.UpdateCustomFrameworkResponse; import com.datadog.api.client.v2.model.UpdateResourceEvaluationFiltersRequest; @@ -164,6 +179,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( @@ -3854,31 +3870,30 @@ public ApiResponse createSecurityFilterWithHttpInfo( } /** - * Create a critical asset. + * Create a due date rule. * - *

See {@link #createSecurityMonitoringCriticalAssetWithHttpInfo}. + *

See {@link #createSecurityFindingsAutomationDueDateRuleWithHttpInfo}. * - * @param body The definition of the new critical asset. (required) - * @return SecurityMonitoringCriticalAssetResponse + * @param body (required) + * @return DueDateRuleResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringCriticalAssetResponse createSecurityMonitoringCriticalAsset( - SecurityMonitoringCriticalAssetCreateRequest body) throws ApiException { - return createSecurityMonitoringCriticalAssetWithHttpInfo(body).getData(); + public DueDateRuleResponse createSecurityFindingsAutomationDueDateRule( + DueDateRuleCreateRequest body) throws ApiException { + return createSecurityFindingsAutomationDueDateRuleWithHttpInfo(body).getData(); } /** - * Create a critical asset. + * Create a due date rule. * - *

See {@link #createSecurityMonitoringCriticalAssetWithHttpInfoAsync}. + *

See {@link #createSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync}. * - * @param body The definition of the new critical asset. (required) - * @return CompletableFuture<SecurityMonitoringCriticalAssetResponse> + * @param body (required) + * @return CompletableFuture<DueDateRuleResponse> */ - public CompletableFuture - createSecurityMonitoringCriticalAssetAsync( - SecurityMonitoringCriticalAssetCreateRequest body) { - return createSecurityMonitoringCriticalAssetWithHttpInfoAsync(body) + public CompletableFuture createSecurityFindingsAutomationDueDateRuleAsync( + DueDateRuleCreateRequest body) { + return createSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -3886,25 +3901,31 @@ public SecurityMonitoringCriticalAssetResponse createSecurityMonitoringCriticalA } /** - * Create a new critical asset. + * Create a new due date rule for the current organization. * - * @param body The definition of the new critical asset. (required) - * @return ApiResponse<SecurityMonitoringCriticalAssetResponse> + * @param body (required) + * @return ApiResponse<DueDateRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * - * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
201 Successfully created the due date rule -
400 Bad Request -
403 Not Authorized -
409 Conflict -
403 Forbidden -
422 Unprocessable Entity -
429 Too many requests -
*/ - public ApiResponse - createSecurityMonitoringCriticalAssetWithHttpInfo( - SecurityMonitoringCriticalAssetCreateRequest body) throws ApiException { + public ApiResponse createSecurityFindingsAutomationDueDateRuleWithHttpInfo( + DueDateRuleCreateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createSecurityFindingsAutomationDueDateRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -3912,22 +3933,22 @@ public SecurityMonitoringCriticalAssetResponse createSecurityMonitoringCriticalA throw new ApiException( 400, "Missing the required parameter 'body' when calling" - + " createSecurityMonitoringCriticalAsset"); + + " createSecurityFindingsAutomationDueDateRule"); } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/critical_assets"; + String localVarPath = "/api/v2/security/findings/automation/due_date_rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringCriticalAsset", + "v2.SecurityMonitoringApi.createSecurityFindingsAutomationDueDateRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "POST", builder, @@ -3936,35 +3957,43 @@ public SecurityMonitoringCriticalAssetResponse createSecurityMonitoringCriticalA localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a critical asset. + * Create a due date rule. * - *

See {@link #createSecurityMonitoringCriticalAssetWithHttpInfo}. + *

See {@link #createSecurityFindingsAutomationDueDateRuleWithHttpInfo}. * - * @param body The definition of the new critical asset. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringCriticalAssetResponse>> + * @param body (required) + * @return CompletableFuture<ApiResponse<DueDateRuleResponse>> */ - public CompletableFuture> - createSecurityMonitoringCriticalAssetWithHttpInfoAsync( - SecurityMonitoringCriticalAssetCreateRequest body) { + public CompletableFuture> + createSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync(DueDateRuleCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createSecurityFindingsAutomationDueDateRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'body' when calling" - + " createSecurityMonitoringCriticalAsset")); + + " createSecurityFindingsAutomationDueDateRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/critical_assets"; + String localVarPath = "/api/v2/security/findings/automation/due_date_rules"; Map localVarHeaderParams = new HashMap(); @@ -3972,16 +4001,15 @@ public SecurityMonitoringCriticalAssetResponse createSecurityMonitoringCriticalA try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringCriticalAsset", + "v2.SecurityMonitoringApi.createSecurityFindingsAutomationDueDateRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -3993,34 +4021,34 @@ public SecurityMonitoringCriticalAssetResponse createSecurityMonitoringCriticalA localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a dataset. + * Create a mute rule. * - *

See {@link #createSecurityMonitoringDatasetWithHttpInfo}. + *

See {@link #createSecurityFindingsAutomationMuteRuleWithHttpInfo}. * * @param body (required) - * @return SecurityMonitoringDatasetCreateResponse + * @return MuteRuleResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringDatasetCreateResponse createSecurityMonitoringDataset( - SecurityMonitoringDatasetCreateRequest body) throws ApiException { - return createSecurityMonitoringDatasetWithHttpInfo(body).getData(); + public MuteRuleResponse createSecurityFindingsAutomationMuteRule(MuteRuleCreateRequest body) + throws ApiException { + return createSecurityFindingsAutomationMuteRuleWithHttpInfo(body).getData(); } /** - * Create a dataset. + * Create a mute rule. * - *

See {@link #createSecurityMonitoringDatasetWithHttpInfoAsync}. + *

See {@link #createSecurityFindingsAutomationMuteRuleWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<SecurityMonitoringDatasetCreateResponse> + * @return CompletableFuture<MuteRuleResponse> */ - public CompletableFuture - createSecurityMonitoringDatasetAsync(SecurityMonitoringDatasetCreateRequest body) { - return createSecurityMonitoringDatasetWithHttpInfoAsync(body) + public CompletableFuture createSecurityFindingsAutomationMuteRuleAsync( + MuteRuleCreateRequest body) { + return createSecurityFindingsAutomationMuteRuleWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -4028,28 +4056,26 @@ public SecurityMonitoringDatasetCreateResponse createSecurityMonitoringDataset( } /** - * Create a new Cloud SIEM dataset. A dataset bundles a data source, a set of indexes, and a - * search query that can be referenced from detection rules. + * Create a new mute rule for the current organization. * * @param body (required) - * @return ApiResponse<SecurityMonitoringDatasetCreateResponse> + * @return ApiResponse<MuteRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * - * + * * *
Response details
Status Code Description Response Headers
201 Created -
201 Successfully created the mute rule -
400 Bad Request -
403 Forbidden -
409 Conflict -
422 Unprocessable Entity -
429 Too many requests -
*/ - public ApiResponse - createSecurityMonitoringDatasetWithHttpInfo(SecurityMonitoringDatasetCreateRequest body) - throws ApiException { + public ApiResponse createSecurityFindingsAutomationMuteRuleWithHttpInfo( + MuteRuleCreateRequest body) throws ApiException { // Check if unstable operation is enabled - String operationId = "createSecurityMonitoringDataset"; + String operationId = "createSecurityFindingsAutomationMuteRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -4061,22 +4087,23 @@ public SecurityMonitoringDatasetCreateResponse createSecurityMonitoringDataset( if (body == null) { throw new ApiException( 400, - "Missing the required parameter 'body' when calling createSecurityMonitoringDataset"); + "Missing the required parameter 'body' when calling" + + " createSecurityFindingsAutomationMuteRule"); } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/datasets"; + String localVarPath = "/api/v2/security/findings/automation/mute_rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringDataset", + "v2.SecurityMonitoringApi.createSecurityFindingsAutomationMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "POST", builder, @@ -4085,27 +4112,25 @@ public SecurityMonitoringDatasetCreateResponse createSecurityMonitoringDataset( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a dataset. + * Create a mute rule. * - *

See {@link #createSecurityMonitoringDatasetWithHttpInfo}. + *

See {@link #createSecurityFindingsAutomationMuteRuleWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringDatasetCreateResponse>> + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> */ - public CompletableFuture> - createSecurityMonitoringDatasetWithHttpInfoAsync( - SecurityMonitoringDatasetCreateRequest body) { + public CompletableFuture> + createSecurityFindingsAutomationMuteRuleWithHttpInfoAsync(MuteRuleCreateRequest body) { // Check if unstable operation is enabled - String operationId = "createSecurityMonitoringDataset"; + String operationId = "createSecurityFindingsAutomationMuteRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; @@ -4114,17 +4139,16 @@ public SecurityMonitoringDatasetCreateResponse createSecurityMonitoringDataset( // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'body' when calling" - + " createSecurityMonitoringDataset")); + + " createSecurityFindingsAutomationMuteRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/datasets"; + String localVarPath = "/api/v2/security/findings/automation/mute_rules"; Map localVarHeaderParams = new HashMap(); @@ -4132,16 +4156,15 @@ public SecurityMonitoringDatasetCreateResponse createSecurityMonitoringDataset( try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringDataset", + "v2.SecurityMonitoringApi.createSecurityFindingsAutomationMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4153,35 +4176,35 @@ public SecurityMonitoringDatasetCreateResponse createSecurityMonitoringDataset( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create an entity context sync configuration. + * Create a ticket creation rule. * - *

See {@link #createSecurityMonitoringIntegrationConfigWithHttpInfo}. + *

See {@link #createSecurityFindingsAutomationTicketCreationRuleWithHttpInfo}. * - * @param body The definition of the new integration configuration. (required) - * @return SecurityMonitoringIntegrationConfigResponse + * @param body (required) + * @return TicketCreationRuleResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringIntegrationConfigResponse createSecurityMonitoringIntegrationConfig( - SecurityMonitoringIntegrationConfigCreateRequest body) throws ApiException { - return createSecurityMonitoringIntegrationConfigWithHttpInfo(body).getData(); + public TicketCreationRuleResponse createSecurityFindingsAutomationTicketCreationRule( + TicketCreationRuleCreateRequest body) throws ApiException { + return createSecurityFindingsAutomationTicketCreationRuleWithHttpInfo(body).getData(); } /** - * Create an entity context sync configuration. + * Create a ticket creation rule. * - *

See {@link #createSecurityMonitoringIntegrationConfigWithHttpInfoAsync}. + *

See {@link #createSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync}. * - * @param body The definition of the new integration configuration. (required) - * @return CompletableFuture<SecurityMonitoringIntegrationConfigResponse> + * @param body (required) + * @return CompletableFuture<TicketCreationRuleResponse> */ - public CompletableFuture - createSecurityMonitoringIntegrationConfigAsync( - SecurityMonitoringIntegrationConfigCreateRequest body) { - return createSecurityMonitoringIntegrationConfigWithHttpInfoAsync(body) + public CompletableFuture + createSecurityFindingsAutomationTicketCreationRuleAsync( + TicketCreationRuleCreateRequest body) { + return createSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -4189,28 +4212,27 @@ public SecurityMonitoringIntegrationConfigResponse createSecurityMonitoringInteg } /** - * Create a new entity context sync configuration so Cloud SIEM can ingest entities from an - * external source. The credentials provided in secrets are validated against the - * source before the configuration is stored and never returned in subsequent responses. + * Create a new ticket creation rule for the current organization. * - * @param body The definition of the new integration configuration. (required) - * @return ApiResponse<SecurityMonitoringIntegrationConfigResponse> + * @param body (required) + * @return ApiResponse<TicketCreationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
201 Successfully created the ticket creation rule -
400 Bad Request -
403 Not Authorized -
403 Forbidden -
422 Unprocessable Entity -
429 Too many requests -
*/ - public ApiResponse - createSecurityMonitoringIntegrationConfigWithHttpInfo( - SecurityMonitoringIntegrationConfigCreateRequest body) throws ApiException { + public ApiResponse + createSecurityFindingsAutomationTicketCreationRuleWithHttpInfo( + TicketCreationRuleCreateRequest body) throws ApiException { // Check if unstable operation is enabled - String operationId = "createSecurityMonitoringIntegrationConfig"; + String operationId = "createSecurityFindingsAutomationTicketCreationRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -4223,22 +4245,22 @@ public SecurityMonitoringIntegrationConfigResponse createSecurityMonitoringInteg throw new ApiException( 400, "Missing the required parameter 'body' when calling" - + " createSecurityMonitoringIntegrationConfig"); + + " createSecurityFindingsAutomationTicketCreationRule"); } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/integration_config"; + String localVarPath = "/api/v2/security/findings/automation/ticket_creation_rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringIntegrationConfig", + "v2.SecurityMonitoringApi.createSecurityFindingsAutomationTicketCreationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "POST", builder, @@ -4247,27 +4269,26 @@ public SecurityMonitoringIntegrationConfigResponse createSecurityMonitoringInteg localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create an entity context sync configuration. + * Create a ticket creation rule. * - *

See {@link #createSecurityMonitoringIntegrationConfigWithHttpInfo}. + *

See {@link #createSecurityFindingsAutomationTicketCreationRuleWithHttpInfo}. * - * @param body The definition of the new integration configuration. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringIntegrationConfigResponse>> + * @param body (required) + * @return CompletableFuture<ApiResponse<TicketCreationRuleResponse>> */ - public CompletableFuture> - createSecurityMonitoringIntegrationConfigWithHttpInfoAsync( - SecurityMonitoringIntegrationConfigCreateRequest body) { + public CompletableFuture> + createSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync( + TicketCreationRuleCreateRequest body) { // Check if unstable operation is enabled - String operationId = "createSecurityMonitoringIntegrationConfig"; + String operationId = "createSecurityFindingsAutomationTicketCreationRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; @@ -4276,17 +4297,16 @@ public SecurityMonitoringIntegrationConfigResponse createSecurityMonitoringInteg // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'body' when calling" - + " createSecurityMonitoringIntegrationConfig")); + + " createSecurityFindingsAutomationTicketCreationRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/integration_config"; + String localVarPath = "/api/v2/security/findings/automation/ticket_creation_rules"; Map localVarHeaderParams = new HashMap(); @@ -4294,16 +4314,15 @@ public SecurityMonitoringIntegrationConfigResponse createSecurityMonitoringInteg try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringIntegrationConfig", + "v2.SecurityMonitoringApi.createSecurityFindingsAutomationTicketCreationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4315,34 +4334,35 @@ public SecurityMonitoringIntegrationConfigResponse createSecurityMonitoringInteg localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a detection rule. + * Create a critical asset. * - *

See {@link #createSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #createSecurityMonitoringCriticalAssetWithHttpInfo}. * - * @param body (required) - * @return SecurityMonitoringRuleResponse + * @param body The definition of the new critical asset. (required) + * @return SecurityMonitoringCriticalAssetResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringRuleResponse createSecurityMonitoringRule( - SecurityMonitoringRuleCreatePayload body) throws ApiException { - return createSecurityMonitoringRuleWithHttpInfo(body).getData(); + public SecurityMonitoringCriticalAssetResponse createSecurityMonitoringCriticalAsset( + SecurityMonitoringCriticalAssetCreateRequest body) throws ApiException { + return createSecurityMonitoringCriticalAssetWithHttpInfo(body).getData(); } /** - * Create a detection rule. + * Create a critical asset. * - *

See {@link #createSecurityMonitoringRuleWithHttpInfoAsync}. + *

See {@link #createSecurityMonitoringCriticalAssetWithHttpInfoAsync}. * - * @param body (required) - * @return CompletableFuture<SecurityMonitoringRuleResponse> + * @param body The definition of the new critical asset. (required) + * @return CompletableFuture<SecurityMonitoringCriticalAssetResponse> */ - public CompletableFuture createSecurityMonitoringRuleAsync( - SecurityMonitoringRuleCreatePayload body) { - return createSecurityMonitoringRuleWithHttpInfoAsync(body) + public CompletableFuture + createSecurityMonitoringCriticalAssetAsync( + SecurityMonitoringCriticalAssetCreateRequest body) { + return createSecurityMonitoringCriticalAssetWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -4350,10 +4370,10 @@ public CompletableFuture createSecurityMonitorin } /** - * Create a detection rule. + * Create a new critical asset. * - * @param body (required) - * @return ApiResponse<SecurityMonitoringRuleResponse> + * @param body The definition of the new critical asset. (required) + * @return ApiResponse<SecurityMonitoringCriticalAssetResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -4362,26 +4382,30 @@ public CompletableFuture createSecurityMonitorin * * * + * * *
200 OK -
400 Bad Request -
403 Not Authorized -
409 Conflict -
429 Too many requests -
*/ - public ApiResponse createSecurityMonitoringRuleWithHttpInfo( - SecurityMonitoringRuleCreatePayload body) throws ApiException { + public ApiResponse + createSecurityMonitoringCriticalAssetWithHttpInfo( + SecurityMonitoringCriticalAssetCreateRequest 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 createSecurityMonitoringRule"); + 400, + "Missing the required parameter 'body' when calling" + + " createSecurityMonitoringCriticalAsset"); } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules"; + String localVarPath = "/api/v2/security_monitoring/configuration/critical_assets"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringRule", + "v2.SecurityMonitoringApi.createSecurityMonitoringCriticalAsset", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4396,33 +4420,35 @@ public ApiResponse createSecurityMonitoringRuleW localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a detection rule. + * Create a critical asset. * - *

See {@link #createSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #createSecurityMonitoringCriticalAssetWithHttpInfo}. * - * @param body (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleResponse>> + * @param body The definition of the new critical asset. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringCriticalAssetResponse>> */ - public CompletableFuture> - createSecurityMonitoringRuleWithHttpInfoAsync(SecurityMonitoringRuleCreatePayload body) { + public CompletableFuture> + createSecurityMonitoringCriticalAssetWithHttpInfoAsync( + SecurityMonitoringCriticalAssetCreateRequest body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling createSecurityMonitoringRule")); + "Missing the required parameter 'body' when calling" + + " createSecurityMonitoringCriticalAsset")); return result; } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules"; + String localVarPath = "/api/v2/security_monitoring/configuration/critical_assets"; Map localVarHeaderParams = new HashMap(); @@ -4430,7 +4456,7 @@ public ApiResponse createSecurityMonitoringRuleW try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringRule", + "v2.SecurityMonitoringApi.createSecurityMonitoringCriticalAsset", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4438,7 +4464,7 @@ public ApiResponse createSecurityMonitoringRuleW new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -4451,34 +4477,34 @@ public ApiResponse createSecurityMonitoringRuleW localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a suppression rule. + * Create a dataset. * - *

See {@link #createSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #createSecurityMonitoringDatasetWithHttpInfo}. * - * @param body The definition of the new suppression rule. (required) - * @return SecurityMonitoringSuppressionResponse + * @param body (required) + * @return SecurityMonitoringDatasetCreateResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSuppressionResponse createSecurityMonitoringSuppression( - SecurityMonitoringSuppressionCreateRequest body) throws ApiException { - return createSecurityMonitoringSuppressionWithHttpInfo(body).getData(); + public SecurityMonitoringDatasetCreateResponse createSecurityMonitoringDataset( + SecurityMonitoringDatasetCreateRequest body) throws ApiException { + return createSecurityMonitoringDatasetWithHttpInfo(body).getData(); } /** - * Create a suppression rule. + * Create a dataset. * - *

See {@link #createSecurityMonitoringSuppressionWithHttpInfoAsync}. + *

See {@link #createSecurityMonitoringDatasetWithHttpInfoAsync}. * - * @param body The definition of the new suppression rule. (required) - * @return CompletableFuture<SecurityMonitoringSuppressionResponse> + * @param body (required) + * @return CompletableFuture<SecurityMonitoringDatasetCreateResponse> */ - public CompletableFuture - createSecurityMonitoringSuppressionAsync(SecurityMonitoringSuppressionCreateRequest body) { - return createSecurityMonitoringSuppressionWithHttpInfoAsync(body) + public CompletableFuture + createSecurityMonitoringDatasetAsync(SecurityMonitoringDatasetCreateRequest body) { + return createSecurityMonitoringDatasetWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -4486,41 +4512,49 @@ public SecurityMonitoringSuppressionResponse createSecurityMonitoringSuppression } /** - * Create a new suppression rule. + * Create a new Cloud SIEM dataset. A dataset bundles a data source, a set of indexes, and a + * search query that can be referenced from detection rules. * - * @param body The definition of the new suppression rule. (required) - * @return ApiResponse<SecurityMonitoringSuppressionResponse> + * @param body (required) + * @return ApiResponse<SecurityMonitoringDatasetCreateResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * * * *
Response details
Status Code Description Response Headers
200 OK -
201 Created -
400 Bad Request -
403 Not Authorized -
403 Forbidden -
409 Conflict -
429 Too many requests -
*/ - public ApiResponse - createSecurityMonitoringSuppressionWithHttpInfo( - SecurityMonitoringSuppressionCreateRequest body) throws ApiException { + public ApiResponse + createSecurityMonitoringDatasetWithHttpInfo(SecurityMonitoringDatasetCreateRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "createSecurityMonitoringDataset"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException( 400, - "Missing the required parameter 'body' when calling createSecurityMonitoringSuppression"); + "Missing the required parameter 'body' when calling createSecurityMonitoringDataset"); } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; + String localVarPath = "/api/v2/security_monitoring/datasets"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.createSecurityMonitoringDataset", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4535,35 +4569,46 @@ public SecurityMonitoringSuppressionResponse createSecurityMonitoringSuppression localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a suppression rule. + * Create a dataset. * - *

See {@link #createSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #createSecurityMonitoringDatasetWithHttpInfo}. * - * @param body The definition of the new suppression rule. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionResponse>> + * @param body (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringDatasetCreateResponse>> */ - public CompletableFuture> - createSecurityMonitoringSuppressionWithHttpInfoAsync( - SecurityMonitoringSuppressionCreateRequest body) { + public CompletableFuture> + createSecurityMonitoringDatasetWithHttpInfoAsync( + SecurityMonitoringDatasetCreateRequest body) { + // Check if unstable operation is enabled + String operationId = "createSecurityMonitoringDataset"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'body' when calling" - + " createSecurityMonitoringSuppression")); + + " createSecurityMonitoringDataset")); return result; } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; + String localVarPath = "/api/v2/security_monitoring/datasets"; Map localVarHeaderParams = new HashMap(); @@ -4571,7 +4616,7 @@ public SecurityMonitoringSuppressionResponse createSecurityMonitoringSuppression try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.createSecurityMonitoringDataset", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4579,7 +4624,7 @@ public SecurityMonitoringSuppressionResponse createSecurityMonitoringSuppression new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -4592,34 +4637,35 @@ public SecurityMonitoringSuppressionResponse createSecurityMonitoringSuppression localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create ServiceNow tickets for security findings. + * Create an entity context sync configuration. * - *

See {@link #createServiceNowTicketsWithHttpInfo}. + *

See {@link #createSecurityMonitoringIntegrationConfigWithHttpInfo}. * - * @param body (required) - * @return FindingCaseResponseArray + * @param body The definition of the new integration configuration. (required) + * @return SecurityMonitoringIntegrationConfigResponse * @throws ApiException if fails to make API call */ - public FindingCaseResponseArray createServiceNowTickets(CreateServiceNowTicketRequestArray body) - throws ApiException { - return createServiceNowTicketsWithHttpInfo(body).getData(); + public SecurityMonitoringIntegrationConfigResponse createSecurityMonitoringIntegrationConfig( + SecurityMonitoringIntegrationConfigCreateRequest body) throws ApiException { + return createSecurityMonitoringIntegrationConfigWithHttpInfo(body).getData(); } /** - * Create ServiceNow tickets for security findings. + * Create an entity context sync configuration. * - *

See {@link #createServiceNowTicketsWithHttpInfoAsync}. + *

See {@link #createSecurityMonitoringIntegrationConfigWithHttpInfoAsync}. * - * @param body (required) - * @return CompletableFuture<FindingCaseResponseArray> + * @param body The definition of the new integration configuration. (required) + * @return CompletableFuture<SecurityMonitoringIntegrationConfigResponse> */ - public CompletableFuture createServiceNowTicketsAsync( - CreateServiceNowTicketRequestArray body) { - return createServiceNowTicketsWithHttpInfoAsync(body) + public CompletableFuture + createSecurityMonitoringIntegrationConfigAsync( + SecurityMonitoringIntegrationConfigCreateRequest body) { + return createSecurityMonitoringIntegrationConfigWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -4627,30 +4673,28 @@ public CompletableFuture createServiceNowTicketsAsync( } /** - * Create ServiceNow tickets for security findings. This operation creates a case in Datadog and a - * ServiceNow ticket linked to that case for bidirectional sync between Datadog and ServiceNow. - * You can create up to 50 ServiceNow tickets per request and associate up to 50 security findings - * per ServiceNow ticket. Security findings that are already attached to another ServiceNow ticket - * will be detached from their previous ServiceNow ticket and attached to the newly created - * ServiceNow ticket. + * Create a new entity context sync configuration so Cloud SIEM can ingest entities from an + * external source. The credentials provided in secrets are validated against the + * source before the configuration is stored and never returned in subsequent responses. * - * @param body (required) - * @return ApiResponse<FindingCaseResponseArray> + * @param body The definition of the new integration configuration. (required) + * @return ApiResponse<SecurityMonitoringIntegrationConfigResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * * *
Response details
Status Code Description Response Headers
201 Created -
200 OK -
400 Bad Request -
404 Not Found -
403 Not Authorized -
429 Too many requests -
*/ - public ApiResponse createServiceNowTicketsWithHttpInfo( - CreateServiceNowTicketRequestArray body) throws ApiException { + public ApiResponse + createSecurityMonitoringIntegrationConfigWithHttpInfo( + SecurityMonitoringIntegrationConfigCreateRequest body) throws ApiException { // Check if unstable operation is enabled - String operationId = "createServiceNowTickets"; + String operationId = "createSecurityMonitoringIntegrationConfig"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -4661,16 +4705,18 @@ public ApiResponse createServiceNowTicketsWithHttpInfo // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling createServiceNowTickets"); + 400, + "Missing the required parameter 'body' when calling" + + " createSecurityMonitoringIntegrationConfig"); } // create path and map variables - String localVarPath = "/api/v2/security/findings/servicenow_tickets"; + String localVarPath = "/api/v2/security_monitoring/configuration/integration_config"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createServiceNowTickets", + "v2.SecurityMonitoringApi.createSecurityMonitoringIntegrationConfig", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4685,25 +4731,27 @@ public ApiResponse createServiceNowTicketsWithHttpInfo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create ServiceNow tickets for security findings. + * Create an entity context sync configuration. * - *

See {@link #createServiceNowTicketsWithHttpInfo}. + *

See {@link #createSecurityMonitoringIntegrationConfigWithHttpInfo}. * - * @param body (required) - * @return CompletableFuture<ApiResponse<FindingCaseResponseArray>> + * @param body The definition of the new integration configuration. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringIntegrationConfigResponse>> */ - public CompletableFuture> - createServiceNowTicketsWithHttpInfoAsync(CreateServiceNowTicketRequestArray body) { + public CompletableFuture> + createSecurityMonitoringIntegrationConfigWithHttpInfoAsync( + SecurityMonitoringIntegrationConfigCreateRequest body) { // Check if unstable operation is enabled - String operationId = "createServiceNowTickets"; + String operationId = "createSecurityMonitoringIntegrationConfig"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; @@ -4712,14 +4760,17 @@ public ApiResponse createServiceNowTicketsWithHttpInfo // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling createServiceNowTickets")); + 400, + "Missing the required parameter 'body' when calling" + + " createSecurityMonitoringIntegrationConfig")); return result; } // create path and map variables - String localVarPath = "/api/v2/security/findings/servicenow_tickets"; + String localVarPath = "/api/v2/security_monitoring/configuration/integration_config"; Map localVarHeaderParams = new HashMap(); @@ -4727,7 +4778,7 @@ public ApiResponse createServiceNowTicketsWithHttpInfo try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createServiceNowTickets", + "v2.SecurityMonitoringApi.createSecurityMonitoringIntegrationConfig", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4735,7 +4786,8 @@ public ApiResponse createServiceNowTicketsWithHttpInfo new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4747,38 +4799,34 @@ public ApiResponse createServiceNowTicketsWithHttpInfo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a new signal-based notification rule. + * Create a detection rule. * - *

See {@link #createSignalNotificationRuleWithHttpInfo}. + *

See {@link #createSecurityMonitoringRuleWithHttpInfo}. * - * @param body The body of the create notification rule request is composed of the rule type and - * the rule attributes: the rule name, the selectors, the notification targets, and the rule - * enabled status. (required) - * @return NotificationRuleResponse + * @param body (required) + * @return SecurityMonitoringRuleResponse * @throws ApiException if fails to make API call */ - public NotificationRuleResponse createSignalNotificationRule( - CreateNotificationRuleParameters body) throws ApiException { - return createSignalNotificationRuleWithHttpInfo(body).getData(); + public SecurityMonitoringRuleResponse createSecurityMonitoringRule( + SecurityMonitoringRuleCreatePayload body) throws ApiException { + return createSecurityMonitoringRuleWithHttpInfo(body).getData(); } /** - * Create a new signal-based notification rule. + * Create a detection rule. * - *

See {@link #createSignalNotificationRuleWithHttpInfoAsync}. + *

See {@link #createSecurityMonitoringRuleWithHttpInfoAsync}. * - * @param body The body of the create notification rule request is composed of the rule type and - * the rule attributes: the rule name, the selectors, the notification targets, and the rule - * enabled status. (required) - * @return CompletableFuture<NotificationRuleResponse> + * @param body (required) + * @return CompletableFuture<SecurityMonitoringRuleResponse> */ - public CompletableFuture createSignalNotificationRuleAsync( - CreateNotificationRuleParameters body) { - return createSignalNotificationRuleWithHttpInfoAsync(body) + public CompletableFuture createSecurityMonitoringRuleAsync( + SecurityMonitoringRuleCreatePayload body) { + return createSecurityMonitoringRuleWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -4786,46 +4834,44 @@ public CompletableFuture createSignalNotificationRuleA } /** - * Create a new notification rule for security signals and return the created rule. + * Create a detection rule. * - * @param body The body of the create notification rule request is composed of the rule type and - * the rule attributes: the rule name, the selectors, the notification targets, and the rule - * enabled status. (required) - * @return ApiResponse<NotificationRuleResponse> + * @param body (required) + * @return ApiResponse<SecurityMonitoringRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * * *
Response details
Status Code Description Response Headers
201 Successfully created the notification rule. -
200 OK -
400 Bad Request -
403 Forbidden -
403 Not Authorized -
429 Too many requests -
*/ - public ApiResponse createSignalNotificationRuleWithHttpInfo( - CreateNotificationRuleParameters body) throws ApiException { + public ApiResponse createSecurityMonitoringRuleWithHttpInfo( + SecurityMonitoringRuleCreatePayload 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 createSignalNotificationRule"); + 400, "Missing the required parameter 'body' when calling createSecurityMonitoringRule"); } // create path and map variables - String localVarPath = "/api/v2/security/signals/notification_rules"; + String localVarPath = "/api/v2/security_monitoring/rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSignalNotificationRule", + "v2.SecurityMonitoringApi.createSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "POST", builder, @@ -4834,34 +4880,33 @@ public ApiResponse createSignalNotificationRuleWithHtt localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a new signal-based notification rule. + * Create a detection rule. * - *

See {@link #createSignalNotificationRuleWithHttpInfo}. + *

See {@link #createSecurityMonitoringRuleWithHttpInfo}. * - * @param body The body of the create notification rule request is composed of the rule type and - * the rule attributes: the rule name, the selectors, the notification targets, and the rule - * enabled status. (required) - * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> - */ - public CompletableFuture> - createSignalNotificationRuleWithHttpInfoAsync(CreateNotificationRuleParameters body) { + * @param body (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleResponse>> + */ + public CompletableFuture> + createSecurityMonitoringRuleWithHttpInfoAsync(SecurityMonitoringRuleCreatePayload body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling createSignalNotificationRule")); + "Missing the required parameter 'body' when calling createSecurityMonitoringRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/security/signals/notification_rules"; + String localVarPath = "/api/v2/security_monitoring/rules"; Map localVarHeaderParams = new HashMap(); @@ -4869,15 +4914,16 @@ public ApiResponse createSignalNotificationRuleWithHtt try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createSignalNotificationRule", + "v2.SecurityMonitoringApi.createSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -4889,32 +4935,34 @@ public ApiResponse createSignalNotificationRuleWithHtt localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get AST for source code. + * Create a suppression rule. * - *

See {@link #createStaticAnalysisAstWithHttpInfo}. + *

See {@link #createSecurityMonitoringSuppressionWithHttpInfo}. * - * @param body (required) - * @return GetAstResponse + * @param body The definition of the new suppression rule. (required) + * @return SecurityMonitoringSuppressionResponse * @throws ApiException if fails to make API call */ - public GetAstResponse createStaticAnalysisAst(GetAstRequest body) throws ApiException { - return createStaticAnalysisAstWithHttpInfo(body).getData(); + public SecurityMonitoringSuppressionResponse createSecurityMonitoringSuppression( + SecurityMonitoringSuppressionCreateRequest body) throws ApiException { + return createSecurityMonitoringSuppressionWithHttpInfo(body).getData(); } /** - * Get AST for source code. + * Create a suppression rule. * - *

See {@link #createStaticAnalysisAstWithHttpInfoAsync}. + *

See {@link #createSecurityMonitoringSuppressionWithHttpInfoAsync}. * - * @param body (required) - * @return CompletableFuture<GetAstResponse> + * @param body The definition of the new suppression rule. (required) + * @return CompletableFuture<SecurityMonitoringSuppressionResponse> */ - public CompletableFuture createStaticAnalysisAstAsync(GetAstRequest body) { - return createStaticAnalysisAstWithHttpInfoAsync(body) + public CompletableFuture + createSecurityMonitoringSuppressionAsync(SecurityMonitoringSuppressionCreateRequest body) { + return createSecurityMonitoringSuppressionWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -4922,10 +4970,10 @@ public CompletableFuture createStaticAnalysisAstAsync(GetAstRequ } /** - * Parse source code into an abstract syntax tree (AST) for the specified language. + * Create a new suppression rule. * - * @param body (required) - * @return ApiResponse<GetAstResponse> + * @param body The definition of the new suppression rule. (required) + * @return ApiResponse<SecurityMonitoringSuppressionResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -4933,34 +4981,30 @@ public CompletableFuture createStaticAnalysisAstAsync(GetAstRequ * * * - * + * + * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Not Authorized -
409 Conflict -
429 Too many requests -
*/ - public ApiResponse createStaticAnalysisAstWithHttpInfo(GetAstRequest body) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "createStaticAnalysisAst"; - 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 + createSecurityMonitoringSuppressionWithHttpInfo( + SecurityMonitoringSuppressionCreateRequest 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 createStaticAnalysisAst"); + 400, + "Missing the required parameter 'body' when calling createSecurityMonitoringSuppression"); } // create path and map variables - String localVarPath = "/api/v2/static-analysis/static-analysis-server/get-ast"; + String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createStaticAnalysisAst", + "v2.SecurityMonitoringApi.createSecurityMonitoringSuppression", localVarPath, new ArrayList(), localVarHeaderParams, @@ -4975,41 +5019,35 @@ public ApiResponse createStaticAnalysisAstWithHttpInfo(GetAstReq localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get AST for source code. + * Create a suppression rule. * - *

See {@link #createStaticAnalysisAstWithHttpInfo}. + *

See {@link #createSecurityMonitoringSuppressionWithHttpInfo}. * - * @param body (required) - * @return CompletableFuture<ApiResponse<GetAstResponse>> + * @param body The definition of the new suppression rule. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionResponse>> */ - public CompletableFuture> createStaticAnalysisAstWithHttpInfoAsync( - GetAstRequest body) { - // Check if unstable operation is enabled - String operationId = "createStaticAnalysisAst"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> + createSecurityMonitoringSuppressionWithHttpInfoAsync( + SecurityMonitoringSuppressionCreateRequest body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling createStaticAnalysisAst")); + 400, + "Missing the required parameter 'body' when calling" + + " createSecurityMonitoringSuppression")); return result; } // create path and map variables - String localVarPath = "/api/v2/static-analysis/static-analysis-server/get-ast"; + String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; Map localVarHeaderParams = new HashMap(); @@ -5017,7 +5055,7 @@ public CompletableFuture> createStaticAnalysisAstWit try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createStaticAnalysisAst", + "v2.SecurityMonitoringApi.createSecurityMonitoringSuppression", localVarPath, new ArrayList(), localVarHeaderParams, @@ -5025,7 +5063,8 @@ public CompletableFuture> createStaticAnalysisAstWit new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -5037,34 +5076,34 @@ public CompletableFuture> createStaticAnalysisAstWit localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Analyze code. + * Create ServiceNow tickets for security findings. * - *

See {@link #createStaticAnalysisServerAnalysisWithHttpInfo}. + *

See {@link #createServiceNowTicketsWithHttpInfo}. * * @param body (required) - * @return AnalysisResponse + * @return FindingCaseResponseArray * @throws ApiException if fails to make API call */ - public AnalysisResponse createStaticAnalysisServerAnalysis(AnalysisRequest body) + public FindingCaseResponseArray createServiceNowTickets(CreateServiceNowTicketRequestArray body) throws ApiException { - return createStaticAnalysisServerAnalysisWithHttpInfo(body).getData(); + return createServiceNowTicketsWithHttpInfo(body).getData(); } /** - * Analyze code. + * Create ServiceNow tickets for security findings. * - *

See {@link #createStaticAnalysisServerAnalysisWithHttpInfoAsync}. + *

See {@link #createServiceNowTicketsWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<AnalysisResponse> + * @return CompletableFuture<FindingCaseResponseArray> */ - public CompletableFuture createStaticAnalysisServerAnalysisAsync( - AnalysisRequest body) { - return createStaticAnalysisServerAnalysisWithHttpInfoAsync(body) + public CompletableFuture createServiceNowTicketsAsync( + CreateServiceNowTicketRequestArray body) { + return createServiceNowTicketsWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -5072,25 +5111,30 @@ public CompletableFuture createStaticAnalysisServerAnalysisAsy } /** - * Run static analysis rules against a source code file and return violations found. + * Create ServiceNow tickets for security findings. This operation creates a case in Datadog and a + * ServiceNow ticket linked to that case for bidirectional sync between Datadog and ServiceNow. + * You can create up to 50 ServiceNow tickets per request and associate up to 50 security findings + * per ServiceNow ticket. Security findings that are already attached to another ServiceNow ticket + * will be detached from their previous ServiceNow ticket and attached to the newly created + * ServiceNow ticket. * * @param body (required) - * @return ApiResponse<AnalysisResponse> + * @return ApiResponse<FindingCaseResponseArray> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * * *
Response details
Status Code Description Response Headers
200 OK -
201 Created -
400 Bad Request -
401 Unauthorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse createStaticAnalysisServerAnalysisWithHttpInfo( - AnalysisRequest body) throws ApiException { + public ApiResponse createServiceNowTicketsWithHttpInfo( + CreateServiceNowTicketRequestArray body) throws ApiException { // Check if unstable operation is enabled - String operationId = "createStaticAnalysisServerAnalysis"; + String operationId = "createServiceNowTickets"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -5101,17 +5145,16 @@ public ApiResponse createStaticAnalysisServerAnalysisWithHttpI // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, - "Missing the required parameter 'body' when calling createStaticAnalysisServerAnalysis"); + 400, "Missing the required parameter 'body' when calling createServiceNowTickets"); } // create path and map variables - String localVarPath = "/api/v2/static-analysis/static-analysis-server/analyze"; + String localVarPath = "/api/v2/security/findings/servicenow_tickets"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createStaticAnalysisServerAnalysis", + "v2.SecurityMonitoringApi.createServiceNowTickets", localVarPath, new ArrayList(), localVarHeaderParams, @@ -5126,25 +5169,25 @@ public ApiResponse createStaticAnalysisServerAnalysisWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Analyze code. + * Create ServiceNow tickets for security findings. * - *

See {@link #createStaticAnalysisServerAnalysisWithHttpInfo}. + *

See {@link #createServiceNowTicketsWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<AnalysisResponse>> + * @return CompletableFuture<ApiResponse<FindingCaseResponseArray>> */ - public CompletableFuture> - createStaticAnalysisServerAnalysisWithHttpInfoAsync(AnalysisRequest body) { + public CompletableFuture> + createServiceNowTicketsWithHttpInfoAsync(CreateServiceNowTicketRequestArray body) { // Check if unstable operation is enabled - String operationId = "createStaticAnalysisServerAnalysis"; + String operationId = "createServiceNowTickets"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; @@ -5153,16 +5196,14 @@ public ApiResponse createStaticAnalysisServerAnalysisWithHttpI // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " createStaticAnalysisServerAnalysis")); + 400, "Missing the required parameter 'body' when calling createServiceNowTickets")); return result; } // create path and map variables - String localVarPath = "/api/v2/static-analysis/static-analysis-server/analyze"; + String localVarPath = "/api/v2/security/findings/servicenow_tickets"; Map localVarHeaderParams = new HashMap(); @@ -5170,7 +5211,7 @@ public ApiResponse createStaticAnalysisServerAnalysisWithHttpI try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createStaticAnalysisServerAnalysis", + "v2.SecurityMonitoringApi.createServiceNowTickets", localVarPath, new ArrayList(), localVarHeaderParams, @@ -5178,7 +5219,7 @@ public ApiResponse createStaticAnalysisServerAnalysisWithHttpI new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -5190,13 +5231,13 @@ public ApiResponse createStaticAnalysisServerAnalysisWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Create a new vulnerability-based notification rule. + * Create a new signal-based notification rule. * - *

See {@link #createVulnerabilityNotificationRuleWithHttpInfo}. + *

See {@link #createSignalNotificationRuleWithHttpInfo}. * * @param body The body of the create notification rule request is composed of the rule type and * the rule attributes: the rule name, the selectors, the notification targets, and the rule @@ -5204,24 +5245,24 @@ public ApiResponse createStaticAnalysisServerAnalysisWithHttpI * @return NotificationRuleResponse * @throws ApiException if fails to make API call */ - public NotificationRuleResponse createVulnerabilityNotificationRule( + public NotificationRuleResponse createSignalNotificationRule( CreateNotificationRuleParameters body) throws ApiException { - return createVulnerabilityNotificationRuleWithHttpInfo(body).getData(); + return createSignalNotificationRuleWithHttpInfo(body).getData(); } /** - * Create a new vulnerability-based notification rule. + * Create a new signal-based notification rule. * - *

See {@link #createVulnerabilityNotificationRuleWithHttpInfoAsync}. + *

See {@link #createSignalNotificationRuleWithHttpInfoAsync}. * * @param body The body of the create notification rule request is composed of the rule type and * the rule attributes: the rule name, the selectors, the notification targets, and the rule * enabled status. (required) * @return CompletableFuture<NotificationRuleResponse> */ - public CompletableFuture createVulnerabilityNotificationRuleAsync( + public CompletableFuture createSignalNotificationRuleAsync( CreateNotificationRuleParameters body) { - return createVulnerabilityNotificationRuleWithHttpInfoAsync(body) + return createSignalNotificationRuleWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -5229,7 +5270,7 @@ public CompletableFuture createVulnerabilityNotificati } /** - * Create a new notification rule for security vulnerabilities and return the created rule. + * Create a new notification rule for security signals and return the created rule. * * @param body The body of the create notification rule request is composed of the rule type and * the rule attributes: the rule name, the selectors, the notification targets, and the rule @@ -5246,24 +5287,23 @@ public CompletableFuture createVulnerabilityNotificati * 429 Too many requests - * */ - public ApiResponse createVulnerabilityNotificationRuleWithHttpInfo( + public ApiResponse createSignalNotificationRuleWithHttpInfo( CreateNotificationRuleParameters 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 createVulnerabilityNotificationRule"); + 400, "Missing the required parameter 'body' when calling createSignalNotificationRule"); } // create path and map variables - String localVarPath = "/api/v2/security/vulnerabilities/notification_rules"; + String localVarPath = "/api/v2/security/signals/notification_rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.createSignalNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -5282,9 +5322,9 @@ public ApiResponse createVulnerabilityNotificationRule } /** - * Create a new vulnerability-based notification rule. + * Create a new signal-based notification rule. * - *

See {@link #createVulnerabilityNotificationRuleWithHttpInfo}. + *

See {@link #createSignalNotificationRuleWithHttpInfo}. * * @param body The body of the create notification rule request is composed of the rule type and * the rule attributes: the rule name, the selectors, the notification targets, and the rule @@ -5292,7 +5332,7 @@ public ApiResponse createVulnerabilityNotificationRule * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> */ public CompletableFuture> - createVulnerabilityNotificationRuleWithHttpInfoAsync(CreateNotificationRuleParameters body) { + createSignalNotificationRuleWithHttpInfoAsync(CreateNotificationRuleParameters body) { Object localVarPostBody = body; // verify the required parameter 'body' is set @@ -5301,12 +5341,11 @@ public ApiResponse createVulnerabilityNotificationRule result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling" - + " createVulnerabilityNotificationRule")); + "Missing the required parameter 'body' when calling createSignalNotificationRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/security/vulnerabilities/notification_rules"; + String localVarPath = "/api/v2/security/signals/notification_rules"; Map localVarHeaderParams = new HashMap(); @@ -5314,7 +5353,7 @@ public ApiResponse createVulnerabilityNotificationRule try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.createVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.createSignalNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -5338,29 +5377,28 @@ public ApiResponse createVulnerabilityNotificationRule } /** - * Deactivate content pack. + * Get AST for source code. * - *

See {@link #deactivateContentPackWithHttpInfo}. + *

See {@link #createStaticAnalysisAstWithHttpInfo}. * - * @param contentPackId The ID of the content pack to deactivate (for example, - * aws-cloudtrail). (required) + * @param body (required) + * @return GetAstResponse * @throws ApiException if fails to make API call */ - public void deactivateContentPack(String contentPackId) throws ApiException { - deactivateContentPackWithHttpInfo(contentPackId); + public GetAstResponse createStaticAnalysisAst(GetAstRequest body) throws ApiException { + return createStaticAnalysisAstWithHttpInfo(body).getData(); } /** - * Deactivate content pack. + * Get AST for source code. * - *

See {@link #deactivateContentPackWithHttpInfoAsync}. + *

See {@link #createStaticAnalysisAstWithHttpInfoAsync}. * - * @param contentPackId The ID of the content pack to deactivate (for example, - * aws-cloudtrail). (required) - * @return CompletableFuture - */ - public CompletableFuture deactivateContentPackAsync(String contentPackId) { - return deactivateContentPackWithHttpInfoAsync(contentPackId) + * @param body (required) + * @return CompletableFuture<GetAstResponse> + */ + public CompletableFuture createStaticAnalysisAstAsync(GetAstRequest body) { + return createStaticAnalysisAstWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -5368,106 +5406,94 @@ public CompletableFuture deactivateContentPackAsync(String contentPackId) } /** - * Deactivate a Cloud SIEM content pack. This operation removes the content pack's configuration - * from log filters or security filters and updates the content pack activation state. + * Parse source code into an abstract syntax tree (AST) for the specified language. * - * @param contentPackId The ID of the content pack to deactivate (for example, - * aws-cloudtrail). (required) - * @return ApiResponse<Void> + * @param body (required) + * @return ApiResponse<GetAstResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * + * + * + * * *
Response details
Status Code Description Response Headers
202 Accepted -
403 Forbidden -
404 Not Found -
200 OK -
400 Bad Request -
401 Unauthorized -
429 Too many requests -
*/ - public ApiResponse deactivateContentPackWithHttpInfo(String contentPackId) + public ApiResponse createStaticAnalysisAstWithHttpInfo(GetAstRequest body) throws ApiException { // Check if unstable operation is enabled - String operationId = "deactivateContentPack"; + String operationId = "createStaticAnalysisAst"; 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; + Object localVarPostBody = body; - // verify the required parameter 'contentPackId' is set - if (contentPackId == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'contentPackId' when calling deactivateContentPack"); + 400, "Missing the required parameter 'body' when calling createStaticAnalysisAst"); } // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/content_packs/{content_pack_id}/deactivate" - .replaceAll( - "\\{" + "content_pack_id" + "\\}", - apiClient.escapeString(contentPackId.toString())); + String localVarPath = "/api/v2/static-analysis/static-analysis-server/get-ast"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deactivateContentPack", + "v2.SecurityMonitoringApi.createStaticAnalysisAst", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "PUT", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Deactivate content pack. + * Get AST for source code. * - *

See {@link #deactivateContentPackWithHttpInfo}. + *

See {@link #createStaticAnalysisAstWithHttpInfo}. * - * @param contentPackId The ID of the content pack to deactivate (for example, - * aws-cloudtrail). (required) - * @return CompletableFuture<ApiResponse<Void>> + * @param body (required) + * @return CompletableFuture<ApiResponse<GetAstResponse>> */ - public CompletableFuture> deactivateContentPackWithHttpInfoAsync( - String contentPackId) { + public CompletableFuture> createStaticAnalysisAstWithHttpInfoAsync( + GetAstRequest body) { // Check if unstable operation is enabled - String operationId = "deactivateContentPack"; + String operationId = "createStaticAnalysisAst"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } - Object localVarPostBody = null; + Object localVarPostBody = body; - // verify the required parameter 'contentPackId' is set - if (contentPackId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'contentPackId' when calling deactivateContentPack")); + 400, "Missing the required parameter 'body' when calling createStaticAnalysisAst")); return result; } // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/content_packs/{content_pack_id}/deactivate" - .replaceAll( - "\\{" + "content_pack_id" + "\\}", - apiClient.escapeString(contentPackId.toString())); + String localVarPath = "/api/v2/static-analysis/static-analysis-server/get-ast"; Map localVarHeaderParams = new HashMap(); @@ -5475,56 +5501,54 @@ public CompletableFuture> deactivateContentPackWithHttpInfoAsy try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deactivateContentPack", + "v2.SecurityMonitoringApi.createStaticAnalysisAst", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PUT", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Delete a custom framework. + * Analyze code. * - *

See {@link #deleteCustomFrameworkWithHttpInfo}. + *

See {@link #createStaticAnalysisServerAnalysisWithHttpInfo}. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @return DeleteCustomFrameworkResponse + * @param body (required) + * @return AnalysisResponse * @throws ApiException if fails to make API call */ - public DeleteCustomFrameworkResponse deleteCustomFramework(String handle, String version) + public AnalysisResponse createStaticAnalysisServerAnalysis(AnalysisRequest body) throws ApiException { - return deleteCustomFrameworkWithHttpInfo(handle, version).getData(); + return createStaticAnalysisServerAnalysisWithHttpInfo(body).getData(); } /** - * Delete a custom framework. + * Analyze code. * - *

See {@link #deleteCustomFrameworkWithHttpInfoAsync}. + *

See {@link #createStaticAnalysisServerAnalysisWithHttpInfoAsync}. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @return CompletableFuture<DeleteCustomFrameworkResponse> + * @param body (required) + * @return CompletableFuture<AnalysisResponse> */ - public CompletableFuture deleteCustomFrameworkAsync( - String handle, String version) { - return deleteCustomFrameworkWithHttpInfoAsync(handle, version) + public CompletableFuture createStaticAnalysisServerAnalysisAsync( + AnalysisRequest body) { + return createStaticAnalysisServerAnalysisWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -5532,11 +5556,10 @@ public CompletableFuture deleteCustomFrameworkAsy } /** - * Delete a custom framework. + * Run static analysis rules against a source code file and return violations found. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @return ApiResponse<DeleteCustomFrameworkResponse> + * @param body (required) + * @return ApiResponse<AnalysisResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -5544,36 +5567,35 @@ public CompletableFuture deleteCustomFrameworkAsy * * * + * * - * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
429 Too many requests -
500 Bad Request -
*/ - public ApiResponse deleteCustomFrameworkWithHttpInfo( - String handle, String version) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'handle' is set - if (handle == null) { - throw new ApiException( - 400, "Missing the required parameter 'handle' when calling deleteCustomFramework"); + public ApiResponse createStaticAnalysisServerAnalysisWithHttpInfo( + AnalysisRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "createStaticAnalysisServerAnalysis"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } + Object localVarPostBody = body; - // verify the required parameter 'version' is set - if (version == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'version' when calling deleteCustomFramework"); + 400, + "Missing the required parameter 'body' when calling createStaticAnalysisServerAnalysis"); } // create path and map variables - String localVarPath = - "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" - .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + String localVarPath = "/api/v2/static-analysis/static-analysis-server/analyze"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteCustomFramework", + "v2.SecurityMonitoringApi.createStaticAnalysisServerAnalysis", localVarPath, new ArrayList(), localVarHeaderParams, @@ -5581,53 +5603,50 @@ public ApiResponse deleteCustomFrameworkWithHttpI new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Delete a custom framework. + * Analyze code. * - *

See {@link #deleteCustomFrameworkWithHttpInfo}. + *

See {@link #createStaticAnalysisServerAnalysisWithHttpInfo}. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @return CompletableFuture<ApiResponse<DeleteCustomFrameworkResponse>> + * @param body (required) + * @return CompletableFuture<ApiResponse<AnalysisResponse>> */ - public CompletableFuture> - deleteCustomFrameworkWithHttpInfoAsync(String handle, String version) { - Object localVarPostBody = null; - - // verify the required parameter 'handle' is set - if (handle == null) { - CompletableFuture> result = - new CompletableFuture<>(); + public CompletableFuture> + createStaticAnalysisServerAnalysisWithHttpInfoAsync(AnalysisRequest body) { + // Check if unstable operation is enabled + String operationId = "createStaticAnalysisServerAnalysis"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'handle' when calling deleteCustomFramework")); + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } + Object localVarPostBody = body; - // verify the required parameter 'version' is set - if (version == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'version' when calling deleteCustomFramework")); + 400, + "Missing the required parameter 'body' when calling" + + " createStaticAnalysisServerAnalysis")); return result; } // create path and map variables - String localVarPath = - "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" - .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + String localVarPath = "/api/v2/static-analysis/static-analysis-server/analyze"; Map localVarHeaderParams = new HashMap(); @@ -5635,7 +5654,7 @@ public ApiResponse deleteCustomFrameworkWithHttpI try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteCustomFramework", + "v2.SecurityMonitoringApi.createStaticAnalysisServerAnalysis", localVarPath, new ArrayList(), localVarHeaderParams, @@ -5643,44 +5662,50 @@ public ApiResponse deleteCustomFrameworkWithHttpI new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Delete an existing job. + * Create a new vulnerability-based notification rule. * - *

See {@link #deleteHistoricalJobWithHttpInfo}. + *

See {@link #createVulnerabilityNotificationRuleWithHttpInfo}. * - * @param jobId The ID of the job. (required) + * @param body The body of the create notification rule request is composed of the rule type and + * the rule attributes: the rule name, the selectors, the notification targets, and the rule + * enabled status. (required) + * @return NotificationRuleResponse * @throws ApiException if fails to make API call */ - public void deleteHistoricalJob(String jobId) throws ApiException { - deleteHistoricalJobWithHttpInfo(jobId); + public NotificationRuleResponse createVulnerabilityNotificationRule( + CreateNotificationRuleParameters body) throws ApiException { + return createVulnerabilityNotificationRuleWithHttpInfo(body).getData(); } /** - * Delete an existing job. + * Create a new vulnerability-based notification rule. * - *

See {@link #deleteHistoricalJobWithHttpInfoAsync}. + *

See {@link #createVulnerabilityNotificationRuleWithHttpInfoAsync}. * - * @param jobId The ID of the job. (required) - * @return CompletableFuture + * @param body The body of the create notification rule request is composed of the rule type and + * the rule attributes: the rule name, the selectors, the notification targets, and the rule + * enabled status. (required) + * @return CompletableFuture<NotificationRuleResponse> */ - public CompletableFuture deleteHistoricalJobAsync(String jobId) { - return deleteHistoricalJobWithHttpInfoAsync(jobId) + public CompletableFuture createVulnerabilityNotificationRuleAsync( + CreateNotificationRuleParameters body) { + return createVulnerabilityNotificationRuleWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -5688,99 +5713,84 @@ public CompletableFuture deleteHistoricalJobAsync(String jobId) { } /** - * Delete an existing job. + * Create a new notification rule for security vulnerabilities and return the created rule. * - * @param jobId The ID of the job. (required) - * @return ApiResponse<Void> + * @param body The body of the create notification rule request is composed of the rule type and + * the rule attributes: the rule name, the selectors, the notification targets, and the rule + * enabled status. (required) + * @return ApiResponse<NotificationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * - * - * - * + * * *
Response details
Status Code Description Response Headers
204 OK -
201 Successfully created the notification rule. -
400 Bad Request -
401 Concurrent Modification -
403 Not Authorized -
404 Not Found -
409 Conflict -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse deleteHistoricalJobWithHttpInfo(String jobId) throws ApiException { - // Check if unstable operation is enabled - String operationId = "deleteHistoricalJob"; - 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; + public ApiResponse createVulnerabilityNotificationRuleWithHttpInfo( + CreateNotificationRuleParameters body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter 'jobId' is set - if (jobId == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'jobId' when calling deleteHistoricalJob"); + 400, + "Missing the required parameter 'body' when calling createVulnerabilityNotificationRule"); } // 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/notification_rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteHistoricalJob", + "v2.SecurityMonitoringApi.createVulnerabilityNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Delete an existing job. + * Create a new vulnerability-based notification rule. * - *

See {@link #deleteHistoricalJobWithHttpInfo}. + *

See {@link #createVulnerabilityNotificationRuleWithHttpInfo}. * - * @param jobId The ID of the job. (required) - * @return CompletableFuture<ApiResponse<Void>> + * @param body The body of the create notification rule request is composed of the rule type and + * the rule attributes: the rule name, the selectors, the notification targets, and the rule + * enabled status. (required) + * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> */ - public CompletableFuture> deleteHistoricalJobWithHttpInfoAsync(String jobId) { - // Check if unstable operation is enabled - String operationId = "deleteHistoricalJob"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } - Object localVarPostBody = null; + public CompletableFuture> + createVulnerabilityNotificationRuleWithHttpInfoAsync(CreateNotificationRuleParameters body) { + Object localVarPostBody = body; - // verify the required parameter 'jobId' is set - if (jobId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'jobId' when calling deleteHistoricalJob")); + 400, + "Missing the required parameter 'body' when calling" + + " createVulnerabilityNotificationRule")); 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/notification_rules"; Map localVarHeaderParams = new HashMap(); @@ -5788,56 +5798,53 @@ public CompletableFuture> deleteHistoricalJobWithHttpInfoAsync try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteHistoricalJob", + "v2.SecurityMonitoringApi.createVulnerabilityNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Unsubscribe from sample log generation. + * Deactivate content pack. * - *

See {@link #deleteSampleLogGenerationSubscriptionWithHttpInfo}. + *

See {@link #deactivateContentPackWithHttpInfo}. * - * @param contentPackId The identifier of the Cloud SIEM content pack to operate on (for example, - * aws-cloudtrail). (required) - * @return SampleLogGenerationSubscriptionResponse + * @param contentPackId The ID of the content pack to deactivate (for example, + * aws-cloudtrail). (required) * @throws ApiException if fails to make API call */ - public SampleLogGenerationSubscriptionResponse deleteSampleLogGenerationSubscription( - String contentPackId) throws ApiException { - return deleteSampleLogGenerationSubscriptionWithHttpInfo(contentPackId).getData(); + public void deactivateContentPack(String contentPackId) throws ApiException { + deactivateContentPackWithHttpInfo(contentPackId); } /** - * Unsubscribe from sample log generation. + * Deactivate content pack. * - *

See {@link #deleteSampleLogGenerationSubscriptionWithHttpInfoAsync}. + *

See {@link #deactivateContentPackWithHttpInfoAsync}. * - * @param contentPackId The identifier of the Cloud SIEM content pack to operate on (for example, - * aws-cloudtrail). (required) - * @return CompletableFuture<SampleLogGenerationSubscriptionResponse> + * @param contentPackId The ID of the content pack to deactivate (for example, + * aws-cloudtrail). (required) + * @return CompletableFuture */ - public CompletableFuture - deleteSampleLogGenerationSubscriptionAsync(String contentPackId) { - return deleteSampleLogGenerationSubscriptionWithHttpInfoAsync(contentPackId) + public CompletableFuture deactivateContentPackAsync(String contentPackId) { + return deactivateContentPackWithHttpInfoAsync(contentPackId) .thenApply( response -> { return response.getData(); @@ -5845,32 +5852,27 @@ public SampleLogGenerationSubscriptionResponse deleteSampleLogGenerationSubscrip } /** - * Unsubscribe from sample log generation for a Cloud SIEM content pack. After unsubscribing, no - * more sample logs are generated for the requested content pack. - * - *

Availability: this endpoint is restricted to Cloud SIEM trial organizations - * on an eligible pricing model. Non-trial orgs receive 403 Forbidden, the feature - * flag may also reject requests with 400 Bad Request, and legacy pricing tiers - * receive a response with status: not_available. + * Deactivate a Cloud SIEM content pack. This operation removes the content pack's configuration + * from log filters or security filters and updates the content pack activation state. * - * @param contentPackId The identifier of the Cloud SIEM content pack to operate on (for example, - * aws-cloudtrail). (required) - * @return ApiResponse<SampleLogGenerationSubscriptionResponse> + * @param contentPackId The ID of the content pack to deactivate (for example, + * aws-cloudtrail). (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
202 Accepted -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - deleteSampleLogGenerationSubscriptionWithHttpInfo(String contentPackId) throws ApiException { + public ApiResponse deactivateContentPackWithHttpInfo(String contentPackId) + throws ApiException { // Check if unstable operation is enabled - String operationId = "deleteSampleLogGenerationSubscription"; + String operationId = "deactivateContentPack"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -5881,13 +5883,11 @@ public SampleLogGenerationSubscriptionResponse deleteSampleLogGenerationSubscrip // verify the required parameter 'contentPackId' is set if (contentPackId == null) { throw new ApiException( - 400, - "Missing the required parameter 'contentPackId' when calling" - + " deleteSampleLogGenerationSubscription"); + 400, "Missing the required parameter 'contentPackId' when calling deactivateContentPack"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/sample_log_generation/subscriptions/{content_pack_id}" + "/api/v2/security_monitoring/content_packs/{content_pack_id}/deactivate" .replaceAll( "\\{" + "content_pack_id" + "\\}", apiClient.escapeString(contentPackId.toString())); @@ -5896,42 +5896,41 @@ public SampleLogGenerationSubscriptionResponse deleteSampleLogGenerationSubscrip Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSampleLogGenerationSubscription", + "v2.SecurityMonitoringApi.deactivateContentPack", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "DELETE", + "PUT", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Unsubscribe from sample log generation. + * Deactivate content pack. * - *

See {@link #deleteSampleLogGenerationSubscriptionWithHttpInfo}. + *

See {@link #deactivateContentPackWithHttpInfo}. * - * @param contentPackId The identifier of the Cloud SIEM content pack to operate on (for example, - * aws-cloudtrail). (required) - * @return CompletableFuture<ApiResponse<SampleLogGenerationSubscriptionResponse>> + * @param contentPackId The ID of the content pack to deactivate (for example, + * aws-cloudtrail). (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - deleteSampleLogGenerationSubscriptionWithHttpInfoAsync(String contentPackId) { + public CompletableFuture> deactivateContentPackWithHttpInfoAsync( + String contentPackId) { // Check if unstable operation is enabled - String operationId = "deleteSampleLogGenerationSubscription"; + String operationId = "deactivateContentPack"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; @@ -5940,18 +5939,16 @@ public SampleLogGenerationSubscriptionResponse deleteSampleLogGenerationSubscrip // verify the required parameter 'contentPackId' is set if (contentPackId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'contentPackId' when calling" - + " deleteSampleLogGenerationSubscription")); + "Missing the required parameter 'contentPackId' when calling deactivateContentPack")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/sample_log_generation/subscriptions/{content_pack_id}" + "/api/v2/security_monitoring/content_packs/{content_pack_id}/deactivate" .replaceAll( "\\{" + "content_pack_id" + "\\}", apiClient.escapeString(contentPackId.toString())); @@ -5962,52 +5959,56 @@ public SampleLogGenerationSubscriptionResponse deleteSampleLogGenerationSubscrip try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSampleLogGenerationSubscription", + "v2.SecurityMonitoringApi.deactivateContentPack", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "DELETE", + "PUT", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Delete a security filter. + * Delete a custom framework. * - *

See {@link #deleteSecurityFilterWithHttpInfo}. + *

See {@link #deleteCustomFrameworkWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) + * @param handle The framework handle (required) + * @param version The framework version (required) + * @return DeleteCustomFrameworkResponse * @throws ApiException if fails to make API call */ - public void deleteSecurityFilter(String securityFilterId) throws ApiException { - deleteSecurityFilterWithHttpInfo(securityFilterId); + public DeleteCustomFrameworkResponse deleteCustomFramework(String handle, String version) + throws ApiException { + return deleteCustomFrameworkWithHttpInfo(handle, version).getData(); } /** - * Delete a security filter. + * Delete a custom framework. * - *

See {@link #deleteSecurityFilterWithHttpInfoAsync}. + *

See {@link #deleteCustomFrameworkWithHttpInfoAsync}. * - * @param securityFilterId The ID of the security filter. (required) - * @return CompletableFuture + * @param handle The framework handle (required) + * @param version The framework version (required) + * @return CompletableFuture<DeleteCustomFrameworkResponse> */ - public CompletableFuture deleteSecurityFilterAsync(String securityFilterId) { - return deleteSecurityFilterWithHttpInfoAsync(securityFilterId) + public CompletableFuture deleteCustomFrameworkAsync( + String handle, String version) { + return deleteCustomFrameworkWithHttpInfoAsync(handle, version) .thenApply( response -> { return response.getData(); @@ -6015,48 +6016,53 @@ public CompletableFuture deleteSecurityFilterAsync(String securityFilterId } /** - * Delete a specific security filter. + * Delete a custom framework. * - * @param securityFilterId The ID of the security filter. (required) - * @return ApiResponse<Void> + * @param handle The framework handle (required) + * @param version The framework version (required) + * @return ApiResponse<DeleteCustomFrameworkResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * + * + * * + * *
Response details
Status Code Description Response Headers
204 OK -
403 Not Authorized -
404 Not Found -
200 OK -
400 Bad Request -
429 Too many requests -
500 Bad Request -
*/ - public ApiResponse deleteSecurityFilterWithHttpInfo(String securityFilterId) - throws ApiException { + public ApiResponse deleteCustomFrameworkWithHttpInfo( + String handle, String version) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'securityFilterId' is set - if (securityFilterId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'securityFilterId' when calling deleteSecurityFilter"); + // verify the required parameter 'handle' is set + if (handle == null) { + throw new ApiException( + 400, "Missing the required parameter 'handle' when calling deleteCustomFramework"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + 400, "Missing the required parameter 'version' when calling deleteCustomFramework"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" + .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityFilter", + "v2.SecurityMonitoringApi.deleteCustomFramework", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "DELETE", @@ -6066,37 +6072,46 @@ public ApiResponse deleteSecurityFilterWithHttpInfo(String securityFilterI localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Delete a security filter. + * Delete a custom framework. * - *

See {@link #deleteSecurityFilterWithHttpInfo}. + *

See {@link #deleteCustomFrameworkWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) - * @return CompletableFuture<ApiResponse<Void>> + * @param handle The framework handle (required) + * @param version The framework version (required) + * @return CompletableFuture<ApiResponse<DeleteCustomFrameworkResponse>> */ - public CompletableFuture> deleteSecurityFilterWithHttpInfoAsync( - String securityFilterId) { + public CompletableFuture> + deleteCustomFrameworkWithHttpInfoAsync(String handle, String version) { Object localVarPostBody = null; - // verify the required parameter 'securityFilterId' is set - if (securityFilterId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'handle' is set + if (handle == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'securityFilterId' when calling" - + " deleteSecurityFilter")); + 400, "Missing the required parameter 'handle' when calling deleteCustomFramework")); + return result; + } + + // verify the required parameter 'version' is set + if (version == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'version' when calling deleteCustomFramework")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" + .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); Map localVarHeaderParams = new HashMap(); @@ -6104,15 +6119,16 @@ public CompletableFuture> deleteSecurityFilterWithHttpInfoAsyn try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityFilter", + "v2.SecurityMonitoringApi.deleteCustomFramework", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -6124,32 +6140,31 @@ public CompletableFuture> deleteSecurityFilterWithHttpInfoAsyn localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Delete a critical asset. + * Delete an existing job. * - *

See {@link #deleteSecurityMonitoringCriticalAssetWithHttpInfo}. + *

See {@link #deleteHistoricalJobWithHttpInfo}. * - * @param criticalAssetId The ID of the critical asset. (required) + * @param jobId The ID of the job. (required) * @throws ApiException if fails to make API call */ - public void deleteSecurityMonitoringCriticalAsset(String criticalAssetId) throws ApiException { - deleteSecurityMonitoringCriticalAssetWithHttpInfo(criticalAssetId); + public void deleteHistoricalJob(String jobId) throws ApiException { + deleteHistoricalJobWithHttpInfo(jobId); } /** - * Delete a critical asset. + * Delete an existing job. * - *

See {@link #deleteSecurityMonitoringCriticalAssetWithHttpInfoAsync}. + *

See {@link #deleteHistoricalJobWithHttpInfoAsync}. * - * @param criticalAssetId The ID of the critical asset. (required) + * @param jobId The ID of the job. (required) * @return CompletableFuture */ - public CompletableFuture deleteSecurityMonitoringCriticalAssetAsync( - String criticalAssetId) { - return deleteSecurityMonitoringCriticalAssetWithHttpInfoAsync(criticalAssetId) + public CompletableFuture deleteHistoricalJobAsync(String jobId) { + return deleteHistoricalJobWithHttpInfoAsync(jobId) .thenApply( response -> { return response.getData(); @@ -6157,9 +6172,9 @@ public CompletableFuture deleteSecurityMonitoringCriticalAssetAsync( } /** - * Delete a specific critical asset. + * Delete an existing job. * - * @param criticalAssetId The ID of the critical asset. (required) + * @param jobId The ID of the job. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -6167,34 +6182,39 @@ public CompletableFuture deleteSecurityMonitoringCriticalAssetAsync( * Response details * Status Code Description Response Headers * 204 OK - + * 400 Bad Request - + * 401 Concurrent Modification - * 403 Not Authorized - * 404 Not Found - + * 409 Conflict - * 429 Too many requests - * */ - public ApiResponse deleteSecurityMonitoringCriticalAssetWithHttpInfo(String criticalAssetId) - throws ApiException { + public ApiResponse deleteHistoricalJobWithHttpInfo(String jobId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteHistoricalJob"; + 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 'criticalAssetId' is set - if (criticalAssetId == null) { + // verify the required parameter 'jobId' is set + if (jobId == null) { throw new ApiException( - 400, - "Missing the required parameter 'criticalAssetId' when calling" - + " deleteSecurityMonitoringCriticalAsset"); + 400, "Missing the required parameter 'jobId' when calling deleteHistoricalJob"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}" - .replaceAll( - "\\{" + "critical_asset_id" + "\\}", - apiClient.escapeString(criticalAssetId.toString())); + "/api/v2/siem-historical-detections/jobs/{job_id}" + .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringCriticalAsset", + "v2.SecurityMonitoringApi.deleteHistoricalJob", localVarPath, new ArrayList(), localVarHeaderParams, @@ -6213,33 +6233,38 @@ public ApiResponse deleteSecurityMonitoringCriticalAssetWithHttpInfo(Strin } /** - * Delete a critical asset. + * Delete an existing job. * - *

See {@link #deleteSecurityMonitoringCriticalAssetWithHttpInfo}. + *

See {@link #deleteHistoricalJobWithHttpInfo}. * - * @param criticalAssetId The ID of the critical asset. (required) + * @param jobId The ID of the job. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - deleteSecurityMonitoringCriticalAssetWithHttpInfoAsync(String criticalAssetId) { + public CompletableFuture> deleteHistoricalJobWithHttpInfoAsync(String jobId) { + // Check if unstable operation is enabled + String operationId = "deleteHistoricalJob"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - // verify the required parameter 'criticalAssetId' is set - if (criticalAssetId == null) { + // verify the required parameter 'jobId' is set + if (jobId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'criticalAssetId' when calling" - + " deleteSecurityMonitoringCriticalAsset")); + 400, "Missing the required parameter 'jobId' when calling deleteHistoricalJob")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}" - .replaceAll( - "\\{" + "critical_asset_id" + "\\}", - apiClient.escapeString(criticalAssetId.toString())); + "/api/v2/siem-historical-detections/jobs/{job_id}" + .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); Map localVarHeaderParams = new HashMap(); @@ -6247,7 +6272,7 @@ public ApiResponse deleteSecurityMonitoringCriticalAssetWithHttpInfo(Strin try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringCriticalAsset", + "v2.SecurityMonitoringApi.deleteHistoricalJob", localVarPath, new ArrayList(), localVarHeaderParams, @@ -6271,27 +6296,32 @@ public ApiResponse deleteSecurityMonitoringCriticalAssetWithHttpInfo(Strin } /** - * Delete a dataset. + * Unsubscribe from sample log generation. * - *

See {@link #deleteSecurityMonitoringDatasetWithHttpInfo}. + *

See {@link #deleteSampleLogGenerationSubscriptionWithHttpInfo}. * - * @param datasetId The UUID of the dataset. (required) + * @param contentPackId The identifier of the Cloud SIEM content pack to operate on (for example, + * aws-cloudtrail). (required) + * @return SampleLogGenerationSubscriptionResponse * @throws ApiException if fails to make API call */ - public void deleteSecurityMonitoringDataset(String datasetId) throws ApiException { - deleteSecurityMonitoringDatasetWithHttpInfo(datasetId); + public SampleLogGenerationSubscriptionResponse deleteSampleLogGenerationSubscription( + String contentPackId) throws ApiException { + return deleteSampleLogGenerationSubscriptionWithHttpInfo(contentPackId).getData(); } /** - * Delete a dataset. + * Unsubscribe from sample log generation. * - *

See {@link #deleteSecurityMonitoringDatasetWithHttpInfoAsync}. + *

See {@link #deleteSampleLogGenerationSubscriptionWithHttpInfoAsync}. * - * @param datasetId The UUID of the dataset. (required) - * @return CompletableFuture + * @param contentPackId The identifier of the Cloud SIEM content pack to operate on (for example, + * aws-cloudtrail). (required) + * @return CompletableFuture<SampleLogGenerationSubscriptionResponse> */ - public CompletableFuture deleteSecurityMonitoringDatasetAsync(String datasetId) { - return deleteSecurityMonitoringDatasetWithHttpInfoAsync(datasetId) + public CompletableFuture + deleteSampleLogGenerationSubscriptionAsync(String contentPackId) { + return deleteSampleLogGenerationSubscriptionWithHttpInfoAsync(contentPackId) .thenApply( response -> { return response.getData(); @@ -6299,27 +6329,32 @@ public CompletableFuture deleteSecurityMonitoringDatasetAsync(String datas } /** - * Delete a Cloud SIEM dataset. Out-of-the-box datasets cannot be deleted and deleting a dataset - * that is referenced by a detection rule is rejected. + * Unsubscribe from sample log generation for a Cloud SIEM content pack. After unsubscribing, no + * more sample logs are generated for the requested content pack. * - * @param datasetId The UUID of the dataset. (required) - * @return ApiResponse<Void> + *

Availability: this endpoint is restricted to Cloud SIEM trial organizations + * on an eligible pricing model. Non-trial orgs receive 403 Forbidden, the feature + * flag may also reject requests with 400 Bad Request, and legacy pricing tiers + * receive a response with status: not_available. + * + * @param contentPackId The identifier of the Cloud SIEM content pack to operate on (for example, + * aws-cloudtrail). (required) + * @return ApiResponse<SampleLogGenerationSubscriptionResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * - * + * * *
Response details
Status Code Description Response Headers
204 No Content -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
403 Not Authorized -
429 Too many requests -
*/ - public ApiResponse deleteSecurityMonitoringDatasetWithHttpInfo(String datasetId) - throws ApiException { + public ApiResponse + deleteSampleLogGenerationSubscriptionWithHttpInfo(String contentPackId) throws ApiException { // Check if unstable operation is enabled - String operationId = "deleteSecurityMonitoringDataset"; + String operationId = "deleteSampleLogGenerationSubscription"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -6327,28 +6362,30 @@ public ApiResponse deleteSecurityMonitoringDatasetWithHttpInfo(String data } Object localVarPostBody = null; - // verify the required parameter 'datasetId' is set - if (datasetId == null) { + // verify the required parameter 'contentPackId' is set + if (contentPackId == null) { throw new ApiException( 400, - "Missing the required parameter 'datasetId' when calling" - + " deleteSecurityMonitoringDataset"); + "Missing the required parameter 'contentPackId' when calling" + + " deleteSampleLogGenerationSubscription"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/datasets/{dataset_id}" - .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); + "/api/v2/security_monitoring/sample_log_generation/subscriptions/{content_pack_id}" + .replaceAll( + "\\{" + "content_pack_id" + "\\}", + apiClient.escapeString(contentPackId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringDataset", + "v2.SecurityMonitoringApi.deleteSampleLogGenerationSubscription", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "DELETE", @@ -6358,45 +6395,50 @@ public ApiResponse deleteSecurityMonitoringDatasetWithHttpInfo(String data localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Delete a dataset. + * Unsubscribe from sample log generation. * - *

See {@link #deleteSecurityMonitoringDatasetWithHttpInfo}. + *

See {@link #deleteSampleLogGenerationSubscriptionWithHttpInfo}. * - * @param datasetId The UUID of the dataset. (required) - * @return CompletableFuture<ApiResponse<Void>> + * @param contentPackId The identifier of the Cloud SIEM content pack to operate on (for example, + * aws-cloudtrail). (required) + * @return CompletableFuture<ApiResponse<SampleLogGenerationSubscriptionResponse>> */ - public CompletableFuture> deleteSecurityMonitoringDatasetWithHttpInfoAsync( - String datasetId) { + public CompletableFuture> + deleteSampleLogGenerationSubscriptionWithHttpInfoAsync(String contentPackId) { // Check if unstable operation is enabled - String operationId = "deleteSecurityMonitoringDataset"; + String operationId = "deleteSampleLogGenerationSubscription"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - // verify the required parameter 'datasetId' is set - if (datasetId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'contentPackId' is set + if (contentPackId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'datasetId' when calling" - + " deleteSecurityMonitoringDataset")); + "Missing the required parameter 'contentPackId' when calling" + + " deleteSampleLogGenerationSubscription")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/datasets/{dataset_id}" - .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); + "/api/v2/security_monitoring/sample_log_generation/subscriptions/{content_pack_id}" + .replaceAll( + "\\{" + "content_pack_id" + "\\}", + apiClient.escapeString(contentPackId.toString())); Map localVarHeaderParams = new HashMap(); @@ -6404,15 +6446,16 @@ public CompletableFuture> deleteSecurityMonitoringDatasetWithH try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringDataset", + "v2.SecurityMonitoringApi.deleteSampleLogGenerationSubscription", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"*/*"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -6424,33 +6467,31 @@ public CompletableFuture> deleteSecurityMonitoringDatasetWithH localVarPostBody, new HashMap(), false, - null); + new GenericType() {}); } /** - * Delete an entity context sync configuration. + * Delete a security filter. * - *

See {@link #deleteSecurityMonitoringIntegrationConfigWithHttpInfo}. + *

See {@link #deleteSecurityFilterWithHttpInfo}. * - * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @param securityFilterId The ID of the security filter. (required) * @throws ApiException if fails to make API call */ - public void deleteSecurityMonitoringIntegrationConfig(String integrationConfigId) - throws ApiException { - deleteSecurityMonitoringIntegrationConfigWithHttpInfo(integrationConfigId); + public void deleteSecurityFilter(String securityFilterId) throws ApiException { + deleteSecurityFilterWithHttpInfo(securityFilterId); } /** - * Delete an entity context sync configuration. + * Delete a security filter. * - *

See {@link #deleteSecurityMonitoringIntegrationConfigWithHttpInfoAsync}. + *

See {@link #deleteSecurityFilterWithHttpInfoAsync}. * - * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @param securityFilterId The ID of the security filter. (required) * @return CompletableFuture */ - public CompletableFuture deleteSecurityMonitoringIntegrationConfigAsync( - String integrationConfigId) { - return deleteSecurityMonitoringIntegrationConfigWithHttpInfoAsync(integrationConfigId) + public CompletableFuture deleteSecurityFilterAsync(String securityFilterId) { + return deleteSecurityFilterWithHttpInfoAsync(securityFilterId) .thenApply( response -> { return response.getData(); @@ -6458,10 +6499,9 @@ public CompletableFuture deleteSecurityMonitoringIntegrationConfigAsync( } /** - * Delete an entity context sync configuration. Cloud SIEM stops ingesting entities from this - * source, and the credentials stored for the configuration are removed from the secrets store. + * Delete a specific security filter. * - * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @param securityFilterId The ID of the security filter. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -6474,36 +6514,28 @@ public CompletableFuture deleteSecurityMonitoringIntegrationConfigAsync( * 429 Too many requests - * */ - public ApiResponse deleteSecurityMonitoringIntegrationConfigWithHttpInfo( - String integrationConfigId) throws ApiException { - // Check if unstable operation is enabled - String operationId = "deleteSecurityMonitoringIntegrationConfig"; - 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 deleteSecurityFilterWithHttpInfo(String securityFilterId) + throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'integrationConfigId' is set - if (integrationConfigId == null) { + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { throw new ApiException( 400, - "Missing the required parameter 'integrationConfigId' when calling" - + " deleteSecurityMonitoringIntegrationConfig"); + "Missing the required parameter 'securityFilterId' when calling deleteSecurityFilter"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" .replaceAll( - "\\{" + "integration_config_id" + "\\}", - apiClient.escapeString(integrationConfigId.toString())); + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringIntegrationConfig", + "v2.SecurityMonitoringApi.deleteSecurityFilter", localVarPath, new ArrayList(), localVarHeaderParams, @@ -6522,43 +6554,33 @@ public ApiResponse deleteSecurityMonitoringIntegrationConfigWithHttpInfo( } /** - * Delete an entity context sync configuration. + * Delete a security filter. * - *

See {@link #deleteSecurityMonitoringIntegrationConfigWithHttpInfo}. + *

See {@link #deleteSecurityFilterWithHttpInfo}. * - * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @param securityFilterId The ID of the security filter. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - deleteSecurityMonitoringIntegrationConfigWithHttpInfoAsync(String integrationConfigId) { - // Check if unstable operation is enabled - String operationId = "deleteSecurityMonitoringIntegrationConfig"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> deleteSecurityFilterWithHttpInfoAsync( + String securityFilterId) { Object localVarPostBody = null; - // verify the required parameter 'integrationConfigId' is set - if (integrationConfigId == null) { + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'integrationConfigId' when calling" - + " deleteSecurityMonitoringIntegrationConfig")); + "Missing the required parameter 'securityFilterId' when calling" + + " deleteSecurityFilter")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" .replaceAll( - "\\{" + "integration_config_id" + "\\}", - apiClient.escapeString(integrationConfigId.toString())); + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); Map localVarHeaderParams = new HashMap(); @@ -6566,7 +6588,7 @@ public ApiResponse deleteSecurityMonitoringIntegrationConfigWithHttpInfo( try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringIntegrationConfig", + "v2.SecurityMonitoringApi.deleteSecurityFilter", localVarPath, new ArrayList(), localVarHeaderParams, @@ -6590,27 +6612,27 @@ public ApiResponse deleteSecurityMonitoringIntegrationConfigWithHttpInfo( } /** - * Delete an existing rule. + * Delete a due date rule. * - *

See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. + *

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

See {@link #deleteSecurityMonitoringRuleWithHttpInfoAsync}. + *

See {@link #deleteSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) + * @param ruleId The ID of the due date rule. (required) * @return CompletableFuture */ - public CompletableFuture deleteSecurityMonitoringRuleAsync(String ruleId) { - return deleteSecurityMonitoringRuleWithHttpInfoAsync(ruleId) + public CompletableFuture deleteSecurityFindingsAutomationDueDateRuleAsync(UUID ruleId) { + return deleteSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -6618,46 +6640,55 @@ public CompletableFuture deleteSecurityMonitoringRuleAsync(String ruleId) } /** - * Delete an existing rule. Default rules cannot be deleted. + * Delete an existing due date rule by ID. * - * @param ruleId The ID of the rule. (required) + * @param ruleId The ID of the due date rule. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
204 OK -
403 Not Authorized -
204 Rule successfully deleted. -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteSecurityMonitoringRuleWithHttpInfo(String ruleId) + public ApiResponse deleteSecurityFindingsAutomationDueDateRuleWithHttpInfo(UUID ruleId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteSecurityFindingsAutomationDueDateRule"; + 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 'ruleId' is set if (ruleId == null) { throw new ApiException( - 400, "Missing the required parameter 'ruleId' when calling deleteSecurityMonitoringRule"); + 400, + "Missing the required parameter 'ruleId' when calling" + + " deleteSecurityFindingsAutomationDueDateRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}" + "/api/v2/security/findings/automation/due_date_rules/{rule_id}" .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", + "v2.SecurityMonitoringApi.deleteSecurityFindingsAutomationDueDateRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "DELETE", builder, @@ -6670,15 +6701,25 @@ public ApiResponse deleteSecurityMonitoringRuleWithHttpInfo(String ruleId) } /** - * Delete an existing rule. + * Delete a due date rule. * - *

See {@link #deleteSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #deleteSecurityFindingsAutomationDueDateRuleWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) + * @param ruleId The ID of the due date rule. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteSecurityMonitoringRuleWithHttpInfoAsync( - String ruleId) { + public CompletableFuture> + deleteSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync(UUID ruleId) { + // Check if unstable operation is enabled + String operationId = "deleteSecurityFindingsAutomationDueDateRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; // verify the required parameter 'ruleId' is set @@ -6687,12 +6728,13 @@ public CompletableFuture> deleteSecurityMonitoringRuleWithHttp result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'ruleId' when calling deleteSecurityMonitoringRule")); + "Missing the required parameter 'ruleId' when calling" + + " deleteSecurityFindingsAutomationDueDateRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}" + "/api/v2/security/findings/automation/due_date_rules/{rule_id}" .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -6701,13 +6743,13 @@ public CompletableFuture> deleteSecurityMonitoringRuleWithHttp try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringRule", + "v2.SecurityMonitoringApi.deleteSecurityFindingsAutomationDueDateRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -6725,27 +6767,27 @@ public CompletableFuture> deleteSecurityMonitoringRuleWithHttp } /** - * Delete a suppression rule. + * Delete a mute rule. * - *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #deleteSecurityFindingsAutomationMuteRuleWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) + * @param ruleId The ID of the mute rule. (required) * @throws ApiException if fails to make API call */ - public void deleteSecurityMonitoringSuppression(String suppressionId) throws ApiException { - deleteSecurityMonitoringSuppressionWithHttpInfo(suppressionId); + public void deleteSecurityFindingsAutomationMuteRule(UUID ruleId) throws ApiException { + deleteSecurityFindingsAutomationMuteRuleWithHttpInfo(ruleId); } /** - * Delete a suppression rule. + * Delete a mute rule. * - *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfoAsync}. + *

See {@link #deleteSecurityFindingsAutomationMuteRuleWithHttpInfoAsync}. * - * @param suppressionId The ID of the suppression rule (required) + * @param ruleId The ID of the mute rule. (required) * @return CompletableFuture */ - public CompletableFuture deleteSecurityMonitoringSuppressionAsync(String suppressionId) { - return deleteSecurityMonitoringSuppressionWithHttpInfoAsync(suppressionId) + public CompletableFuture deleteSecurityFindingsAutomationMuteRuleAsync(UUID ruleId) { + return deleteSecurityFindingsAutomationMuteRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -6753,49 +6795,55 @@ public CompletableFuture deleteSecurityMonitoringSuppressionAsync(String s } /** - * Delete a specific suppression rule. + * Delete an existing mute rule by ID. * - * @param suppressionId The ID of the suppression rule (required) + * @param ruleId The ID of the mute rule. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
204 OK -
403 Not Authorized -
204 Rule successfully deleted. -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteSecurityMonitoringSuppressionWithHttpInfo(String suppressionId) + public ApiResponse deleteSecurityFindingsAutomationMuteRuleWithHttpInfo(UUID ruleId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteSecurityFindingsAutomationMuteRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( 400, - "Missing the required parameter 'suppressionId' when calling" - + " deleteSecurityMonitoringSuppression"); + "Missing the required parameter 'ruleId' when calling" + + " deleteSecurityFindingsAutomationMuteRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" - .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "/api/v2/security/findings/automation/mute_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.deleteSecurityFindingsAutomationMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "DELETE", builder, @@ -6808,32 +6856,41 @@ public ApiResponse deleteSecurityMonitoringSuppressionWithHttpInfo(String } /** - * Delete a suppression rule. + * Delete a mute rule. * - *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #deleteSecurityFindingsAutomationMuteRuleWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) + * @param ruleId The ID of the mute rule. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteSecurityMonitoringSuppressionWithHttpInfoAsync( - String suppressionId) { + public CompletableFuture> + deleteSecurityFindingsAutomationMuteRuleWithHttpInfoAsync(UUID ruleId) { + // Check if unstable operation is enabled + String operationId = "deleteSecurityFindingsAutomationMuteRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'suppressionId' when calling" - + " deleteSecurityMonitoringSuppression")); + "Missing the required parameter 'ruleId' when calling" + + " deleteSecurityFindingsAutomationMuteRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" - .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "/api/v2/security/findings/automation/mute_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -6841,13 +6898,13 @@ public CompletableFuture> deleteSecurityMonitoringSuppressionW try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.deleteSecurityFindingsAutomationMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -6865,27 +6922,28 @@ public CompletableFuture> deleteSecurityMonitoringSuppressionW } /** - * Delete a signal-based notification rule. + * Delete a ticket creation rule. * - *

See {@link #deleteSignalNotificationRuleWithHttpInfo}. + *

See {@link #deleteSecurityFindingsAutomationTicketCreationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param ruleId The ID of the ticket creation rule. (required) * @throws ApiException if fails to make API call */ - public void deleteSignalNotificationRule(String id) throws ApiException { - deleteSignalNotificationRuleWithHttpInfo(id); + public void deleteSecurityFindingsAutomationTicketCreationRule(UUID ruleId) throws ApiException { + deleteSecurityFindingsAutomationTicketCreationRuleWithHttpInfo(ruleId); } /** - * Delete a signal-based notification rule. + * Delete a ticket creation rule. * - *

See {@link #deleteSignalNotificationRuleWithHttpInfoAsync}. + *

See {@link #deleteSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param ruleId The ID of the ticket creation rule. (required) * @return CompletableFuture */ - public CompletableFuture deleteSignalNotificationRuleAsync(String id) { - return deleteSignalNotificationRuleWithHttpInfoAsync(id) + public CompletableFuture deleteSecurityFindingsAutomationTicketCreationRuleAsync( + UUID ruleId) { + return deleteSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -6893,9 +6951,9 @@ public CompletableFuture deleteSignalNotificationRuleAsync(String id) { } /** - * Delete a notification rule for security signals. + * Delete an existing ticket creation rule by ID. * - * @param id ID of the notification rule. (required) + * @param ruleId The ID of the ticket creation rule. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -6908,24 +6966,34 @@ public CompletableFuture deleteSignalNotificationRuleAsync(String id) { * 429 Too many requests - * */ - public ApiResponse deleteSignalNotificationRuleWithHttpInfo(String id) throws ApiException { + public ApiResponse deleteSecurityFindingsAutomationTicketCreationRuleWithHttpInfo( + UUID ruleId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteSecurityFindingsAutomationTicketCreationRule"; + 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 '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" + + " deleteSecurityFindingsAutomationTicketCreationRule"); } // create path and map variables String localVarPath = - "/api/v2/security/signals/notification_rules/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + "/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSignalNotificationRule", + "v2.SecurityMonitoringApi.deleteSecurityFindingsAutomationTicketCreationRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -6944,30 +7012,41 @@ public ApiResponse deleteSignalNotificationRuleWithHttpInfo(String id) thr } /** - * Delete a signal-based notification rule. + * Delete a ticket creation rule. * - *

See {@link #deleteSignalNotificationRuleWithHttpInfo}. + *

See {@link #deleteSecurityFindingsAutomationTicketCreationRuleWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param ruleId The ID of the ticket creation rule. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteSignalNotificationRuleWithHttpInfoAsync( - String id) { + public CompletableFuture> + deleteSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync(UUID ruleId) { + // Check if unstable operation is enabled + String operationId = "deleteSecurityFindingsAutomationTicketCreationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'id' when calling deleteSignalNotificationRule")); + "Missing the required parameter 'ruleId' when calling" + + " deleteSecurityFindingsAutomationTicketCreationRule")); 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/findings/automation/ticket_creation_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -6975,7 +7054,7 @@ public CompletableFuture> deleteSignalNotificationRuleWithHttp try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteSignalNotificationRule", + "v2.SecurityMonitoringApi.deleteSecurityFindingsAutomationTicketCreationRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -6999,27 +7078,28 @@ public CompletableFuture> deleteSignalNotificationRuleWithHttp } /** - * Delete a vulnerability-based notification rule. + * Delete a critical asset. * - *

See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringCriticalAssetWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param criticalAssetId The ID of the critical asset. (required) * @throws ApiException if fails to make API call */ - public void deleteVulnerabilityNotificationRule(String id) throws ApiException { - deleteVulnerabilityNotificationRuleWithHttpInfo(id); + public void deleteSecurityMonitoringCriticalAsset(String criticalAssetId) throws ApiException { + deleteSecurityMonitoringCriticalAssetWithHttpInfo(criticalAssetId); } /** - * Delete a vulnerability-based notification rule. + * Delete a critical asset. * - *

See {@link #deleteVulnerabilityNotificationRuleWithHttpInfoAsync}. + *

See {@link #deleteSecurityMonitoringCriticalAssetWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) + * @param criticalAssetId The ID of the critical asset. (required) * @return CompletableFuture */ - public CompletableFuture deleteVulnerabilityNotificationRuleAsync(String id) { - return deleteVulnerabilityNotificationRuleWithHttpInfoAsync(id) + public CompletableFuture deleteSecurityMonitoringCriticalAssetAsync( + String criticalAssetId) { + return deleteSecurityMonitoringCriticalAssetWithHttpInfoAsync(criticalAssetId) .thenApply( response -> { return response.getData(); @@ -7027,47 +7107,50 @@ public CompletableFuture deleteVulnerabilityNotificationRuleAsync(String i } /** - * Delete a notification rule for security vulnerabilities. + * Delete a specific critical asset. * - * @param id ID of the notification rule. (required) + * @param criticalAssetId The ID of the critical asset. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
204 Rule successfully deleted. -
403 Forbidden -
204 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse deleteVulnerabilityNotificationRuleWithHttpInfo(String id) + public ApiResponse deleteSecurityMonitoringCriticalAssetWithHttpInfo(String criticalAssetId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { + // verify the required parameter 'criticalAssetId' is set + if (criticalAssetId == null) { throw new ApiException( 400, - "Missing the required parameter 'id' when calling deleteVulnerabilityNotificationRule"); + "Missing the required parameter 'criticalAssetId' when calling" + + " deleteSecurityMonitoringCriticalAsset"); } // 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/critical_assets/{critical_asset_id}" + .replaceAll( + "\\{" + "critical_asset_id" + "\\}", + apiClient.escapeString(criticalAssetId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringCriticalAsset", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "DELETE", builder, @@ -7080,31 +7163,33 @@ public ApiResponse deleteVulnerabilityNotificationRuleWithHttpInfo(String } /** - * Delete a vulnerability-based notification rule. + * Delete a critical asset. * - *

See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringCriticalAssetWithHttpInfo}. * - * @param id ID of the notification rule. (required) + * @param criticalAssetId The ID of the critical asset. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> deleteVulnerabilityNotificationRuleWithHttpInfoAsync( - String id) { + public CompletableFuture> + deleteSecurityMonitoringCriticalAssetWithHttpInfoAsync(String criticalAssetId) { Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { + // verify the required parameter 'criticalAssetId' is set + if (criticalAssetId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'id' when calling" - + " deleteVulnerabilityNotificationRule")); + "Missing the required parameter 'criticalAssetId' when calling" + + " deleteSecurityMonitoringCriticalAsset")); 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/critical_assets/{critical_asset_id}" + .replaceAll( + "\\{" + "critical_asset_id" + "\\}", + apiClient.escapeString(criticalAssetId.toString())); Map localVarHeaderParams = new HashMap(); @@ -7112,13 +7197,13 @@ public CompletableFuture> deleteVulnerabilityNotificationRuleW try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.deleteVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringCriticalAsset", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"*/*"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); @@ -7136,27 +7221,27 @@ public CompletableFuture> deleteVulnerabilityNotificationRuleW } /** - * Detach security findings from their case. + * Delete a dataset. * - *

See {@link #detachCaseWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringDatasetWithHttpInfo}. * - * @param body (required) + * @param datasetId The UUID of the dataset. (required) * @throws ApiException if fails to make API call */ - public void detachCase(DetachCaseRequest body) throws ApiException { - detachCaseWithHttpInfo(body); + public void deleteSecurityMonitoringDataset(String datasetId) throws ApiException { + deleteSecurityMonitoringDatasetWithHttpInfo(datasetId); } /** - * Detach security findings from their case. + * Delete a dataset. * - *

See {@link #detachCaseWithHttpInfoAsync}. + *

See {@link #deleteSecurityMonitoringDatasetWithHttpInfoAsync}. * - * @param body (required) + * @param datasetId The UUID of the dataset. (required) * @return CompletableFuture */ - public CompletableFuture detachCaseAsync(DetachCaseRequest body) { - return detachCaseWithHttpInfoAsync(body) + public CompletableFuture deleteSecurityMonitoringDatasetAsync(String datasetId) { + return deleteSecurityMonitoringDatasetWithHttpInfoAsync(datasetId) .thenApply( response -> { return response.getData(); @@ -7164,12 +7249,10 @@ public CompletableFuture detachCaseAsync(DetachCaseRequest body) { } /** - * Detach security findings from their case. This operation dissociates security findings from - * their associated cases without deleting the cases themselves. You can detach security findings - * from multiple different cases in a single request, with a limit of 50 security findings per - * request. Security findings that are not currently attached to any case will be ignored. + * Delete a Cloud SIEM dataset. Out-of-the-box datasets cannot be deleted and deleting a dataset + * that is referenced by a detection rule is rejected. * - * @param body (required) + * @param datasetId The UUID of the dataset. (required) * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details @@ -7178,25 +7261,39 @@ public CompletableFuture detachCaseAsync(DetachCaseRequest body) { * Status Code Description Response Headers * 204 No Content - * 400 Bad Request - + * 403 Forbidden - * 404 Not Found - * 429 Too many requests - * */ - public ApiResponse detachCaseWithHttpInfo(DetachCaseRequest body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse deleteSecurityMonitoringDatasetWithHttpInfo(String datasetId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteSecurityMonitoringDataset"; + 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 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling detachCase"); + // verify the required parameter 'datasetId' is set + if (datasetId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'datasetId' when calling" + + " deleteSecurityMonitoringDataset"); } // create path and map variables - String localVarPath = "/api/v2/security/findings/cases"; + String localVarPath = + "/api/v2/security_monitoring/datasets/{dataset_id}" + .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.detachCase", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringDataset", localVarPath, new ArrayList(), localVarHeaderParams, @@ -7207,7 +7304,7 @@ public ApiResponse detachCaseWithHttpInfo(DetachCaseRequest body) throws A "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, @@ -7215,25 +7312,41 @@ public ApiResponse detachCaseWithHttpInfo(DetachCaseRequest body) throws A } /** - * Detach security findings from their case. + * Delete a dataset. * - *

See {@link #detachCaseWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringDatasetWithHttpInfo}. * - * @param body (required) + * @param datasetId The UUID of the dataset. (required) * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> detachCaseWithHttpInfoAsync(DetachCaseRequest body) { - Object localVarPostBody = body; + public CompletableFuture> deleteSecurityMonitoringDatasetWithHttpInfoAsync( + String datasetId) { + // Check if unstable operation is enabled + String operationId = "deleteSecurityMonitoringDataset"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'datasetId' is set + if (datasetId == null) { CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'body' when calling detachCase")); + new ApiException( + 400, + "Missing the required parameter 'datasetId' when calling" + + " deleteSecurityMonitoringDataset")); return result; } // create path and map variables - String localVarPath = "/api/v2/security/findings/cases"; + String localVarPath = + "/api/v2/security_monitoring/datasets/{dataset_id}" + .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); Map localVarHeaderParams = new HashMap(); @@ -7241,7 +7354,7 @@ public CompletableFuture> detachCaseWithHttpInfoAsync(DetachCa try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.detachCase", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringDataset", localVarPath, new ArrayList(), localVarHeaderParams, @@ -7257,7 +7370,7 @@ public CompletableFuture> detachCaseWithHttpInfoAsync(DetachCa "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, @@ -7265,33 +7378,29 @@ public CompletableFuture> detachCaseWithHttpInfoAsync(DetachCa } /** - * Update security signal triage state or assignee. + * Delete an entity context sync configuration. * - *

See {@link #editSecurityMonitoringSignalWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringIntegrationConfigWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal triage state or assignee update. (required) - * @return SecurityMonitoringSignalTriageUpdateResponse + * @param integrationConfigId The ID of the entity context sync configuration. (required) * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal( - String signalId, SecurityMonitoringSignalUpdateRequest body) throws ApiException { - return editSecurityMonitoringSignalWithHttpInfo(signalId, body).getData(); + public void deleteSecurityMonitoringIntegrationConfig(String integrationConfigId) + throws ApiException { + deleteSecurityMonitoringIntegrationConfigWithHttpInfo(integrationConfigId); } /** - * Update security signal triage state or assignee. + * Delete an entity context sync configuration. * - *

See {@link #editSecurityMonitoringSignalWithHttpInfoAsync}. + *

See {@link #deleteSecurityMonitoringIntegrationConfigWithHttpInfoAsync}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal triage state or assignee update. (required) - * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> + * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @return CompletableFuture */ - public CompletableFuture - editSecurityMonitoringSignalAsync( - String signalId, SecurityMonitoringSignalUpdateRequest body) { - return editSecurityMonitoringSignalWithHttpInfoAsync(signalId, body) + public CompletableFuture deleteSecurityMonitoringIntegrationConfigAsync( + String integrationConfigId) { + return deleteSecurityMonitoringIntegrationConfigWithHttpInfoAsync(integrationConfigId) .thenApply( response -> { return response.getData(); @@ -7299,108 +7408,107 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Update the triage state or assignee of a security signal. + * Delete an entity context sync configuration. Cloud SIEM stops ingesting entities from this + * source, and the credentials stored for the configuration are removed from the secrets store. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal triage state or assignee update. (required) - * @return ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> + * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
204 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - editSecurityMonitoringSignalWithHttpInfo( - String signalId, SecurityMonitoringSignalUpdateRequest 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 editSecurityMonitoringSignal"); - } - - // verify the required parameter 'body' is set - if (body == null) { + public ApiResponse deleteSecurityMonitoringIntegrationConfigWithHttpInfo( + String integrationConfigId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "deleteSecurityMonitoringIntegrationConfig"; + 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 'integrationConfigId' is set + if (integrationConfigId == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling editSecurityMonitoringSignal"); + 400, + "Missing the required parameter 'integrationConfigId' when calling" + + " deleteSecurityMonitoringIntegrationConfig"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/update" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" + .replaceAll( + "\\{" + "integration_config_id" + "\\}", + apiClient.escapeString(integrationConfigId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignal", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringIntegrationConfig", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Update security signal triage state or assignee. + * Delete an entity context sync configuration. * - *

See {@link #editSecurityMonitoringSignalWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringIntegrationConfigWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal triage state or assignee update. (required) - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> + * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - editSecurityMonitoringSignalWithHttpInfoAsync( - String signalId, SecurityMonitoringSignalUpdateRequest body) { - Object localVarPostBody = body; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + public CompletableFuture> + deleteSecurityMonitoringIntegrationConfigWithHttpInfoAsync(String integrationConfigId) { + // Check if unstable operation is enabled + String operationId = "deleteSecurityMonitoringIntegrationConfig"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignal")); + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'integrationConfigId' is set + if (integrationConfigId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling editSecurityMonitoringSignal")); + "Missing the required parameter 'integrationConfigId' when calling" + + " deleteSecurityMonitoringIntegrationConfig")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/update" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" + .replaceAll( + "\\{" + "integration_config_id" + "\\}", + apiClient.escapeString(integrationConfigId.toString())); Map localVarHeaderParams = new HashMap(); @@ -7408,58 +7516,51 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignal", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringIntegrationConfig", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Modify the triage assignee of a security signal. + * Delete an existing rule. * - *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. + *

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

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfoAsync}. + *

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

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. + *

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

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. + *

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

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfoAsync}. + *

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

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. + *

See {@link #deleteSecurityMonitoringSuppressionWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param body Attributes describing the signal update. (required) - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> + * @param suppressionId The ID of the suppression rule (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - editSecurityMonitoringSignalIncidentsWithHttpInfoAsync( - String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { - Object localVarPostBody = body; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalIncidents")); - return result; - } + public CompletableFuture> deleteSecurityMonitoringSuppressionWithHttpInfoAsync( + String suppressionId) { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalIncidents")); + "Missing the required parameter 'suppressionId' when calling" + + " deleteSecurityMonitoringSuppression")); 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_monitoring/configuration/suppressions/{suppression_id}" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); Map localVarHeaderParams = new HashMap(); @@ -7753,58 +7791,51 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", + "v2.SecurityMonitoringApi.deleteSecurityMonitoringSuppression", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Change the triage state of a security signal. + * Delete a signal-based notification rule. * - *

See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. + *

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 editSecurityMonitoringSignalState( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) throws ApiException { - return editSecurityMonitoringSignalStateWithHttpInfo(signalId, body).getData(); + public void deleteSignalNotificationRule(String id) throws ApiException { + deleteSignalNotificationRuleWithHttpInfo(id); } /** - * Change the triage state of a security signal. + * Delete a signal-based notification rule. * - *

See {@link #editSecurityMonitoringSignalStateWithHttpInfoAsync}. + *

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 - editSecurityMonitoringSignalStateAsync( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) { - return editSecurityMonitoringSignalStateWithHttpInfoAsync(signalId, body) + public CompletableFuture deleteSignalNotificationRuleAsync(String id) { + return deleteSignalNotificationRuleWithHttpInfoAsync(id) .thenApply( response -> { return response.getData(); @@ -7812,111 +7843,81 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal } /** - * Change the triage state 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 * * * - * - * - * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
204 Rule successfully deleted. -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - editSecurityMonitoringSignalStateWithHttpInfo( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalState"); - } + public ApiResponse 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 editSecurityMonitoringSignalState"); + 400, "Missing the required parameter 'id' when calling deleteSignalNotificationRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/state" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security/signals/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + "v2.SecurityMonitoringApi.deleteSignalNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Change the triage state of a security signal. + * Delete a signal-based notification rule. * - *

See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. + *

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> - editSecurityMonitoringSignalStateWithHttpInfoAsync( - String signalId, SecurityMonitoringSignalStateUpdateRequest body) { - Object localVarPostBody = body; - - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'signalId' when calling" - + " editSecurityMonitoringSignalState")); - return result; - } + public CompletableFuture> deleteSignalNotificationRuleWithHttpInfoAsync( + String id) { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling" - + " editSecurityMonitoringSignalState")); + "Missing the required parameter 'id' when calling deleteSignalNotificationRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/state" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security/signals/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); Map localVarHeaderParams = new HashMap(); @@ -7924,59 +7925,51 @@ public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", + "v2.SecurityMonitoringApi.deleteSignalNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "DELETE", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Export security monitoring resource to Terraform. + * Delete a vulnerability-based notification rule. * - *

See {@link #exportSecurityMonitoringTerraformResourceWithHttpInfo}. + *

See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. * - * @param resourceType The type of security monitoring resource to export. (required) - * @param resourceId The ID of the security monitoring resource to export. (required) - * @return SecurityMonitoringTerraformExportResponse + * @param id ID of the notification rule. (required) * @throws ApiException if fails to make API call */ - public SecurityMonitoringTerraformExportResponse exportSecurityMonitoringTerraformResource( - SecurityMonitoringTerraformResourceType resourceType, String resourceId) throws ApiException { - return exportSecurityMonitoringTerraformResourceWithHttpInfo(resourceType, resourceId) - .getData(); + public void deleteVulnerabilityNotificationRule(String id) throws ApiException { + deleteVulnerabilityNotificationRuleWithHttpInfo(id); } /** - * Export security monitoring resource to Terraform. + * Delete a vulnerability-based notification rule. * - *

See {@link #exportSecurityMonitoringTerraformResourceWithHttpInfoAsync}. + *

See {@link #deleteVulnerabilityNotificationRuleWithHttpInfoAsync}. * - * @param resourceType The type of security monitoring resource to export. (required) - * @param resourceId The ID of the security monitoring resource to export. (required) - * @return CompletableFuture<SecurityMonitoringTerraformExportResponse> + * @param id ID of the notification rule. (required) + * @return CompletableFuture */ - public CompletableFuture - exportSecurityMonitoringTerraformResourceAsync( - SecurityMonitoringTerraformResourceType resourceType, String resourceId) { - return exportSecurityMonitoringTerraformResourceWithHttpInfoAsync(resourceType, resourceId) + public CompletableFuture deleteVulnerabilityNotificationRuleAsync(String id) { + return deleteVulnerabilityNotificationRuleWithHttpInfoAsync(id) .thenApply( response -> { return response.getData(); @@ -7984,137 +7977,84 @@ public SecurityMonitoringTerraformExportResponse exportSecurityMonitoringTerrafo } /** - * Export a security monitoring resource to a Terraform configuration. The resource_type - * path parameter specifies the type of resource to export and must be one of - * suppressions or critical_assets. + * Delete a notification rule for security vulnerabilities. * - * @param resourceType The type of security monitoring resource to export. (required) - * @param resourceId The ID of the security monitoring resource to export. (required) - * @return ApiResponse<SecurityMonitoringTerraformExportResponse> + * @param id ID of the notification rule. (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
204 Rule successfully deleted. -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - exportSecurityMonitoringTerraformResourceWithHttpInfo( - SecurityMonitoringTerraformResourceType resourceType, String resourceId) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "exportSecurityMonitoringTerraformResource"; - 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 deleteVulnerabilityNotificationRuleWithHttpInfo(String id) + throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'resourceType' is set - if (resourceType == null) { - throw new ApiException( - 400, - "Missing the required parameter 'resourceType' when calling" - + " exportSecurityMonitoringTerraformResource"); - } - - // verify the required parameter 'resourceId' is set - if (resourceId == null) { + // verify the required parameter 'id' is set + if (id == null) { throw new ApiException( 400, - "Missing the required parameter 'resourceId' when calling" - + " exportSecurityMonitoringTerraformResource"); + "Missing the required parameter 'id' when calling deleteVulnerabilityNotificationRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/terraform/{resource_type}/{resource_id}" - .replaceAll( - "\\{" + "resource_type" + "\\}", apiClient.escapeString(resourceType.toString())) - .replaceAll( - "\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString())); + "/api/v2/security/vulnerabilities/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.exportSecurityMonitoringTerraformResource", + "v2.SecurityMonitoringApi.deleteVulnerabilityNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "GET", + "DELETE", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Export security monitoring resource to Terraform. + * Delete a vulnerability-based notification rule. * - *

See {@link #exportSecurityMonitoringTerraformResourceWithHttpInfo}. + *

See {@link #deleteVulnerabilityNotificationRuleWithHttpInfo}. * - * @param resourceType The type of security monitoring resource to export. (required) - * @param resourceId The ID of the security monitoring resource to export. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringTerraformExportResponse>> + * @param id ID of the notification rule. (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - exportSecurityMonitoringTerraformResourceWithHttpInfoAsync( - SecurityMonitoringTerraformResourceType resourceType, String resourceId) { - // Check if unstable operation is enabled - String operationId = "exportSecurityMonitoringTerraformResource"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> deleteVulnerabilityNotificationRuleWithHttpInfoAsync( + String id) { Object localVarPostBody = null; - // verify the required parameter 'resourceType' is set - if (resourceType == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'resourceType' when calling" - + " exportSecurityMonitoringTerraformResource")); - return result; - } - - // verify the required parameter 'resourceId' is set - if (resourceId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'resourceId' when calling" - + " exportSecurityMonitoringTerraformResource")); + "Missing the required parameter 'id' when calling" + + " deleteVulnerabilityNotificationRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/terraform/{resource_type}/{resource_id}" - .replaceAll( - "\\{" + "resource_type" + "\\}", apiClient.escapeString(resourceType.toString())) - .replaceAll( - "\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString())); + "/api/v2/security/vulnerabilities/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); Map localVarHeaderParams = new HashMap(); @@ -8122,52 +8062,51 @@ public SecurityMonitoringTerraformExportResponse exportSecurityMonitoringTerrafo try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.exportSecurityMonitoringTerraformResource", + "v2.SecurityMonitoringApi.deleteVulnerabilityNotificationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "DELETE", builder, localVarHeaderParams, new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Get content pack states. + * Detach security findings from their case. * - *

See {@link #getContentPacksStatesWithHttpInfo}. + *

See {@link #detachCaseWithHttpInfo}. * - * @return SecurityMonitoringContentPackStatesResponse + * @param body (required) * @throws ApiException if fails to make API call */ - public SecurityMonitoringContentPackStatesResponse getContentPacksStates() throws ApiException { - return getContentPacksStatesWithHttpInfo().getData(); + public void detachCase(DetachCaseRequest body) throws ApiException { + detachCaseWithHttpInfo(body); } /** - * Get content pack states. + * Detach security findings from their case. * - *

See {@link #getContentPacksStatesWithHttpInfoAsync}. + *

See {@link #detachCaseWithHttpInfoAsync}. * - * @return CompletableFuture<SecurityMonitoringContentPackStatesResponse> + * @param body (required) + * @return CompletableFuture */ - public CompletableFuture - getContentPacksStatesAsync() { - return getContentPacksStatesWithHttpInfoAsync() + public CompletableFuture detachCaseAsync(DetachCaseRequest body) { + return detachCaseWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -8175,79 +8114,76 @@ public SecurityMonitoringContentPackStatesResponse getContentPacksStates() throw } /** - * Get the activation state, integration status, and log collection status for all Cloud SIEM - * content packs. + * Detach security findings from their case. This operation dissociates security findings from + * their associated cases without deleting the cases themselves. You can detach security findings + * from multiple different cases in a single request, with a limit of 50 security findings per + * request. Security findings that are not currently attached to any case will be ignored. * - * @return ApiResponse<SecurityMonitoringContentPackStatesResponse> + * @param body (required) + * @return ApiResponse<Void> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
403 Forbidden -
204 No Content -
400 Bad Request -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - getContentPacksStatesWithHttpInfo() throws ApiException { - // Check if unstable operation is enabled - String operationId = "getContentPacksStates"; - 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 detachCaseWithHttpInfo(DetachCaseRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling detachCase"); } - Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/content_packs/states"; + String localVarPath = "/api/v2/security/findings/cases"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getContentPacksStates", + "v2.SecurityMonitoringApi.detachCase", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "DELETE", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Get content pack states. + * Detach security findings from their case. * - *

See {@link #getContentPacksStatesWithHttpInfo}. + *

See {@link #detachCaseWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<SecurityMonitoringContentPackStatesResponse>> + * @param body (required) + * @return CompletableFuture<ApiResponse<Void>> */ - public CompletableFuture> - getContentPacksStatesWithHttpInfoAsync() { - // Check if unstable operation is enabled - String operationId = "getContentPacksStates"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); + public CompletableFuture> detachCaseWithHttpInfoAsync(DetachCaseRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException(400, "Missing the required parameter 'body' when calling detachCase")); return result; } - Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/content_packs/states"; + String localVarPath = "/api/v2/security/findings/cases"; Map localVarHeaderParams = new HashMap(); @@ -8255,55 +8191,57 @@ public SecurityMonitoringContentPackStatesResponse getContentPacksStates() throw try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getContentPacksStates", + "v2.SecurityMonitoringApi.detachCase", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"*/*"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "DELETE", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + null); } /** - * Get critical assets affecting a specific rule. + * Update security signal triage state or assignee. * - *

See {@link #getCriticalAssetsAffectingRuleWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @return SecurityMonitoringCriticalAssetsResponse + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal triage state or assignee update. (required) + * @return SecurityMonitoringSignalTriageUpdateResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringCriticalAssetsResponse getCriticalAssetsAffectingRule(String ruleId) - throws ApiException { - return getCriticalAssetsAffectingRuleWithHttpInfo(ruleId).getData(); - } + public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignal( + String signalId, SecurityMonitoringSignalUpdateRequest body) throws ApiException { + return editSecurityMonitoringSignalWithHttpInfo(signalId, body).getData(); + } /** - * Get critical assets affecting a specific rule. + * Update security signal triage state or assignee. * - *

See {@link #getCriticalAssetsAffectingRuleWithHttpInfoAsync}. + *

See {@link #editSecurityMonitoringSignalWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) - * @return CompletableFuture<SecurityMonitoringCriticalAssetsResponse> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal triage state or assignee update. (required) + * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> */ - public CompletableFuture - getCriticalAssetsAffectingRuleAsync(String ruleId) { - return getCriticalAssetsAffectingRuleWithHttpInfoAsync(ruleId) + public CompletableFuture + editSecurityMonitoringSignalAsync( + String signalId, SecurityMonitoringSignalUpdateRequest body) { + return editSecurityMonitoringSignalWithHttpInfoAsync(signalId, body) .thenApply( response -> { return response.getData(); @@ -8311,41 +8249,50 @@ public SecurityMonitoringCriticalAssetsResponse getCriticalAssetsAffectingRule(S } /** - * Get the list of critical assets that affect a specific existing rule by the rule's ID. + * Update the triage state or assignee of a security signal. * - * @param ruleId The ID of the rule. (required) - * @return ApiResponse<SecurityMonitoringCriticalAssetsResponse> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal triage state or assignee update. (required) + * @return ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - getCriticalAssetsAffectingRuleWithHttpInfo(String ruleId) throws ApiException { - Object localVarPostBody = null; + public ApiResponse + editSecurityMonitoringSignalWithHttpInfo( + String signalId, SecurityMonitoringSignalUpdateRequest body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter 'ruleId' is set - if (ruleId == null) { + // verify the required parameter 'signalId' is set + if (signalId == null) { throw new ApiException( 400, - "Missing the required parameter 'ruleId' when calling getCriticalAssetsAffectingRule"); + "Missing the required parameter 'signalId' when calling editSecurityMonitoringSignal"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling editSecurityMonitoringSignal"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/critical_assets/rules/{rule_id}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + "/api/v2/security_monitoring/signals/{signal_id}/update" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getCriticalAssetsAffectingRule", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignal", localVarPath, new ArrayList(), localVarHeaderParams, @@ -8353,43 +8300,57 @@ public SecurityMonitoringCriticalAssetsResponse getCriticalAssetsAffectingRule(S new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get critical assets affecting a specific rule. + * Update security signal triage state or assignee. * - *

See {@link #getCriticalAssetsAffectingRuleWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringCriticalAssetsResponse>> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal triage state or assignee update. (required) + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> */ - public CompletableFuture> - getCriticalAssetsAffectingRuleWithHttpInfoAsync(String ruleId) { - Object localVarPostBody = null; + public CompletableFuture> + editSecurityMonitoringSignalWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalUpdateRequest body) { + Object localVarPostBody = body; - // verify the required parameter 'ruleId' is set - if (ruleId == null) { - CompletableFuture> result = + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'ruleId' when calling" - + " getCriticalAssetsAffectingRule")); + "Missing the required parameter 'signalId' when calling" + + " editSecurityMonitoringSignal")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling editSecurityMonitoringSignal")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/critical_assets/rules/{rule_id}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + "/api/v2/security_monitoring/signals/{signal_id}/update" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); @@ -8397,7 +8358,7 @@ public SecurityMonitoringCriticalAssetsResponse getCriticalAssetsAffectingRule(S try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getCriticalAssetsAffectingRule", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignal", localVarPath, new ArrayList(), localVarHeaderParams, @@ -8405,49 +8366,50 @@ public SecurityMonitoringCriticalAssetsResponse getCriticalAssetsAffectingRule(S new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a custom framework. + * Modify the triage assignee of a security signal. * - *

See {@link #getCustomFrameworkWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @return GetCustomFrameworkResponse + * @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 GetCustomFrameworkResponse getCustomFramework(String handle, String version) - throws ApiException { - return getCustomFrameworkWithHttpInfo(handle, version).getData(); + public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalAssignee( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) throws ApiException { + return editSecurityMonitoringSignalAssigneeWithHttpInfo(signalId, body).getData(); } /** - * Get a custom framework. + * Modify the triage assignee of a security signal. * - *

See {@link #getCustomFrameworkWithHttpInfoAsync}. + *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfoAsync}. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @return CompletableFuture<GetCustomFrameworkResponse> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> */ - public CompletableFuture getCustomFrameworkAsync( - String handle, String version) { - return getCustomFrameworkWithHttpInfoAsync(handle, version) + public CompletableFuture + editSecurityMonitoringSignalAssigneeAsync( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { + return editSecurityMonitoringSignalAssigneeWithHttpInfoAsync(signalId, body) .thenApply( response -> { return response.getData(); @@ -8455,11 +8417,11 @@ public CompletableFuture getCustomFrameworkAsync( } /** - * Get a custom framework. + * Modify the triage assignee of a security signal. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @return ApiResponse<GetCustomFrameworkResponse> + * @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 * @@ -8467,36 +8429,41 @@ public CompletableFuture getCustomFrameworkAsync( * * * + * + * * - * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
500 Bad Request -
*/ - public ApiResponse getCustomFrameworkWithHttpInfo( - String handle, String version) throws ApiException { - Object localVarPostBody = null; + public ApiResponse + editSecurityMonitoringSignalAssigneeWithHttpInfo( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) throws ApiException { + Object localVarPostBody = body; - // verify the required parameter 'handle' is set - if (handle == null) { + // verify the required parameter 'signalId' is set + if (signalId == null) { throw new ApiException( - 400, "Missing the required parameter 'handle' when calling getCustomFramework"); + 400, + "Missing the required parameter 'signalId' when calling" + + " editSecurityMonitoringSignalAssignee"); } - // verify the required parameter 'version' is set - if (version == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'version' when calling getCustomFramework"); + 400, + "Missing the required parameter 'body' when calling" + + " editSecurityMonitoringSignalAssignee"); } // create path and map variables String localVarPath = - "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" - .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + "/api/v2/security_monitoring/signals/{signal_id}/assignee" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getCustomFramework", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", localVarPath, new ArrayList(), localVarHeaderParams, @@ -8504,51 +8471,58 @@ public ApiResponse getCustomFrameworkWithHttpInfo( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a custom framework. + * Modify the triage assignee of a security signal. * - *

See {@link #getCustomFrameworkWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalAssigneeWithHttpInfo}. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @return CompletableFuture<ApiResponse<GetCustomFrameworkResponse>> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> */ - public CompletableFuture> - getCustomFrameworkWithHttpInfoAsync(String handle, String version) { - Object localVarPostBody = null; + public CompletableFuture> + editSecurityMonitoringSignalAssigneeWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalAssigneeUpdateRequest body) { + Object localVarPostBody = body; - // verify the required parameter 'handle' is set - if (handle == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'handle' when calling getCustomFramework")); + 400, + "Missing the required parameter 'signalId' when calling" + + " editSecurityMonitoringSignalAssignee")); return result; } - // verify the required parameter 'version' is set - if (version == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'version' when calling getCustomFramework")); + 400, + "Missing the required parameter 'body' when calling" + + " editSecurityMonitoringSignalAssignee")); return result; } // create path and map variables String localVarPath = - "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" - .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + "/api/v2/security_monitoring/signals/{signal_id}/assignee" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); @@ -8556,7 +8530,7 @@ public ApiResponse getCustomFrameworkWithHttpInfo( try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getCustomFramework", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalAssignee", localVarPath, new ArrayList(), localVarHeaderParams, @@ -8564,158 +8538,50 @@ public ApiResponse getCustomFrameworkWithHttpInfo( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to getEntityContext. */ - public static class GetEntityContextOptionalParameters { - private String query; - private String from; - private String to; - private String asOf; - private Long limit; - private String pageToken; - - /** - * Set query. - * - * @param query A free-text query (for example, an email address or principal ID) used to filter - * the entities returned. (optional) - * @return GetEntityContextOptionalParameters - */ - public GetEntityContextOptionalParameters query(String query) { - this.query = query; - return this; - } - - /** - * Set from. - * - * @param from The start of the time range to query, as an RFC3339 timestamp or a relative time - * (for example, now-7d). Defaults to now-7d. Ignored when - * as_of is set. (optional, default to "now-7d") - * @return GetEntityContextOptionalParameters - */ - public GetEntityContextOptionalParameters from(String from) { - this.from = from; - return this; - } - - /** - * Set to. - * - * @param to The end of the time range to query, as an RFC3339 timestamp or a relative time (for - * example, now). Defaults to now. Ignored when as_of - * is set. (optional, default to "now") - * @return GetEntityContextOptionalParameters - */ - public GetEntityContextOptionalParameters to(String to) { - this.to = to; - return this; - } - - /** - * Set asOf. - * - * @param asOf A point in time at which to query the entity revisions, as an RFC3339 timestamp, - * a Unix timestamp (in seconds), or a relative time (for example, now-1d). - * When set, from and to are ignored. Cannot be combined with - * custom from / to values. (optional) - * @return GetEntityContextOptionalParameters - */ - public GetEntityContextOptionalParameters asOf(String asOf) { - this.asOf = asOf; - return this; - } - - /** - * Set limit. - * - * @param limit The maximum number of entities to return. (optional, default to 250) - * @return GetEntityContextOptionalParameters - */ - public GetEntityContextOptionalParameters limit(Long limit) { - this.limit = limit; - return this; - } - - /** - * Set pageToken. - * - * @param pageToken An opaque token used to fetch the next page of results, as returned in - * meta.page.next_token of a previous response. (optional) - * @return GetEntityContextOptionalParameters - */ - public GetEntityContextOptionalParameters pageToken(String pageToken) { - this.pageToken = pageToken; - return this; - } - } - - /** - * Get entity context. - * - *

See {@link #getEntityContextWithHttpInfo}. - * - * @return EntityContextResponse - * @throws ApiException if fails to make API call - */ - public EntityContextResponse getEntityContext() throws ApiException { - return getEntityContextWithHttpInfo(new GetEntityContextOptionalParameters()).getData(); - } - - /** - * Get entity context. - * - *

See {@link #getEntityContextWithHttpInfoAsync}. - * - * @return CompletableFuture<EntityContextResponse> - */ - public CompletableFuture getEntityContextAsync() { - return getEntityContextWithHttpInfoAsync(new GetEntityContextOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType() {}); } /** - * Get entity context. + * Change the related incidents of a security signal. * - *

See {@link #getEntityContextWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return EntityContextResponse + * @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 EntityContextResponse getEntityContext(GetEntityContextOptionalParameters parameters) - throws ApiException { - return getEntityContextWithHttpInfo(parameters).getData(); + public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalIncidents( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) throws ApiException { + return editSecurityMonitoringSignalIncidentsWithHttpInfo(signalId, body).getData(); } /** - * Get entity context. + * Change the related incidents of a security signal. * - *

See {@link #getEntityContextWithHttpInfoAsync}. + *

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfoAsync}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<EntityContextResponse> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> */ - public CompletableFuture getEntityContextAsync( - GetEntityContextOptionalParameters parameters) { - return getEntityContextWithHttpInfoAsync(parameters) + public CompletableFuture + editSecurityMonitoringSignalIncidentsAsync( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { + return editSecurityMonitoringSignalIncidentsWithHttpInfoAsync(signalId, body) .thenApply( response -> { return response.getData(); @@ -8723,13 +8589,11 @@ public CompletableFuture getEntityContextAsync( } /** - * Search the Cloud SIEM entity context store for entities that match a query, and return the - * historical revisions of each entity in the requested time range. The endpoint can either return - * revisions across an interval (from / to) or the snapshot of each - * entity at a single point in time (as_of); the two modes are mutually exclusive. + * Change the related incidents for a security signal. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<EntityContextResponse> + * @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 * @@ -8738,198 +8602,159 @@ public CompletableFuture getEntityContextAsync( * * * + * * *
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getEntityContextWithHttpInfo( - GetEntityContextOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "getEntityContext"; - 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 + 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"); } - Object localVarPostBody = null; - String query = parameters.query; - String from = parameters.from; - String to = parameters.to; - String asOf = parameters.asOf; - Long limit = parameters.limit; - String pageToken = parameters.pageToken; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/entity_context"; + String localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}/incidents" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_token", pageToken)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getEntityContext", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get entity context. + * Change the related incidents of a security signal. * - *

See {@link #getEntityContextWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalIncidentsWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<EntityContextResponse>> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> */ - public CompletableFuture> getEntityContextWithHttpInfoAsync( - GetEntityContextOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "getEntityContext"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> + editSecurityMonitoringSignalIncidentsWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalIncidentsUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, + "Missing the required parameter 'signalId' when calling" + + " editSecurityMonitoringSignalIncidents")); return result; } - Object localVarPostBody = null; - String query = parameters.query; - String from = parameters.from; - String to = parameters.to; - String asOf = parameters.asOf; - Long limit = parameters.limit; - String pageToken = parameters.pageToken; - // create path and map variables - String localVarPath = "/api/v2/security_monitoring/entity_context"; - - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_token", pageToken)); - - Invocation.Builder builder; + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " 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 localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getEntityContext", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalIncidents", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to getFinding. */ - public static class GetFindingOptionalParameters { - private Long snapshotTimestamp; - - /** - * Set snapshotTimestamp. - * - * @param snapshotTimestamp Return the finding for a given snapshot of time (Unix ms). - * (optional) - * @return GetFindingOptionalParameters - */ - public GetFindingOptionalParameters snapshotTimestamp(Long snapshotTimestamp) { - this.snapshotTimestamp = snapshotTimestamp; - return this; - } - } - - /** - * Get a finding. - * - *

See {@link #getFindingWithHttpInfo}. - * - * @param findingId The ID of the finding. (required) - * @return GetFindingResponse - * @throws ApiException if fails to make API call - */ - public GetFindingResponse getFinding(String findingId) throws ApiException { - return getFindingWithHttpInfo(findingId, new GetFindingOptionalParameters()).getData(); - } - - /** - * Get a finding. - * - *

See {@link #getFindingWithHttpInfoAsync}. - * - * @param findingId The ID of the finding. (required) - * @return CompletableFuture<GetFindingResponse> - */ - public CompletableFuture getFindingAsync(String findingId) { - return getFindingWithHttpInfoAsync(findingId, new GetFindingOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType() {}); } /** - * Get a finding. + * Change the triage state of a security signal. * - *

See {@link #getFindingWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. * - * @param findingId The ID of the finding. (required) - * @param parameters Optional parameters for the request. - * @return GetFindingResponse + * @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 GetFindingResponse getFinding(String findingId, GetFindingOptionalParameters parameters) - throws ApiException { - return getFindingWithHttpInfo(findingId, parameters).getData(); + public SecurityMonitoringSignalTriageUpdateResponse editSecurityMonitoringSignalState( + String signalId, SecurityMonitoringSignalStateUpdateRequest body) throws ApiException { + return editSecurityMonitoringSignalStateWithHttpInfo(signalId, body).getData(); } /** - * Get a finding. + * Change the triage state of a security signal. * - *

See {@link #getFindingWithHttpInfoAsync}. + *

See {@link #editSecurityMonitoringSignalStateWithHttpInfoAsync}. * - * @param findingId The ID of the finding. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<GetFindingResponse> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return CompletableFuture<SecurityMonitoringSignalTriageUpdateResponse> */ - public CompletableFuture getFindingAsync( - String findingId, GetFindingOptionalParameters parameters) { - return getFindingWithHttpInfoAsync(findingId, parameters) + public CompletableFuture + editSecurityMonitoringSignalStateAsync( + String signalId, SecurityMonitoringSignalStateUpdateRequest body) { + return editSecurityMonitoringSignalStateWithHttpInfoAsync(signalId, body) .thenApply( response -> { return response.getData(); @@ -8937,164 +8762,171 @@ public CompletableFuture getFindingAsync( } /** - * Returns a single finding with message and resource configuration. + * Change the triage state of a security signal. * - * @param findingId The ID of the finding. (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<GetFindingResponse> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return ApiResponse<SecurityMonitoringSignalTriageUpdateResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * - * - * + * + * + * + * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not Found: The requested finding cannot be found. -
429 Too many requests: The rate limit set by the API has been exceeded. -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse 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 + 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"); } - Object localVarPostBody = null; - // verify the required parameter 'findingId' is set - if (findingId == null) { + // verify the required parameter 'body' is set + if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'findingId' when calling getFinding"); + 400, + "Missing the required parameter 'body' when calling editSecurityMonitoringSignalState"); } - 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_monitoring/signals/{signal_id}/state" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getFinding", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a finding. + * Change the triage state of a security signal. * - *

See {@link #getFindingWithHttpInfo}. + *

See {@link #editSecurityMonitoringSignalStateWithHttpInfo}. * - * @param findingId The ID of the finding. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<GetFindingResponse>> + * @param signalId The ID of the signal. (required) + * @param body Attributes describing the signal update. (required) + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringSignalTriageUpdateResponse>> */ - public CompletableFuture> 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> result = new CompletableFuture<>(); + public CompletableFuture> + editSecurityMonitoringSignalStateWithHttpInfoAsync( + String signalId, SecurityMonitoringSignalStateUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, + "Missing the required parameter 'signalId' when calling" + + " editSecurityMonitoringSignalState")); return result; } - Object localVarPostBody = null; - // verify the required parameter 'findingId' is set - if (findingId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'findingId' when calling getFinding")); + 400, + "Missing the required parameter 'body' when calling" + + " editSecurityMonitoringSignalState")); 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_monitoring/signals/{signal_id}/state" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getFinding", + "v2.SecurityMonitoringApi.editSecurityMonitoringSignalState", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a job's details. + * Export security monitoring resource to Terraform. * - *

See {@link #getHistoricalJobWithHttpInfo}. + *

See {@link #exportSecurityMonitoringTerraformResourceWithHttpInfo}. * - * @param jobId The ID of the job. (required) - * @return HistoricalJobResponse + * @param resourceType The type of security monitoring resource to export. (required) + * @param resourceId The ID of the security monitoring resource to export. (required) + * @return SecurityMonitoringTerraformExportResponse * @throws ApiException if fails to make API call */ - public HistoricalJobResponse getHistoricalJob(String jobId) throws ApiException { - return getHistoricalJobWithHttpInfo(jobId).getData(); + public SecurityMonitoringTerraformExportResponse exportSecurityMonitoringTerraformResource( + SecurityMonitoringTerraformResourceType resourceType, String resourceId) throws ApiException { + return exportSecurityMonitoringTerraformResourceWithHttpInfo(resourceType, resourceId) + .getData(); } /** - * Get a job's details. + * Export security monitoring resource to Terraform. * - *

See {@link #getHistoricalJobWithHttpInfoAsync}. + *

See {@link #exportSecurityMonitoringTerraformResourceWithHttpInfoAsync}. * - * @param jobId The ID of the job. (required) - * @return CompletableFuture<HistoricalJobResponse> + * @param resourceType The type of security monitoring resource to export. (required) + * @param resourceId The ID of the security monitoring resource to export. (required) + * @return CompletableFuture<SecurityMonitoringTerraformExportResponse> */ - public CompletableFuture getHistoricalJobAsync(String jobId) { - return getHistoricalJobWithHttpInfoAsync(jobId) + public CompletableFuture + exportSecurityMonitoringTerraformResourceAsync( + SecurityMonitoringTerraformResourceType resourceType, String resourceId) { + return exportSecurityMonitoringTerraformResourceWithHttpInfoAsync(resourceType, resourceId) .thenApply( response -> { return response.getData(); @@ -9102,26 +8934,30 @@ public CompletableFuture getHistoricalJobAsync(String job } /** - * Get a job's details. + * Export a security monitoring resource to a Terraform configuration. The resource_type + * path parameter specifies the type of resource to export and must be one of + * suppressions or critical_assets. * - * @param jobId The ID of the job. (required) - * @return ApiResponse<HistoricalJobResponse> + * @param resourceType The type of security monitoring resource to export. (required) + * @param resourceId The ID of the security monitoring resource to export. (required) + * @return ApiResponse<SecurityMonitoringTerraformExportResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getHistoricalJobWithHttpInfo(String jobId) - throws ApiException { + public ApiResponse + exportSecurityMonitoringTerraformResourceWithHttpInfo( + SecurityMonitoringTerraformResourceType resourceType, String resourceId) + throws ApiException { // Check if unstable operation is enabled - String operationId = "getHistoricalJob"; + String operationId = "exportSecurityMonitoringTerraformResource"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -9129,21 +8965,34 @@ public ApiResponse getHistoricalJobWithHttpInfo(String jo } Object localVarPostBody = null; - // verify the required parameter 'jobId' is set - if (jobId == null) { + // verify the required parameter 'resourceType' is set + if (resourceType == null) { throw new ApiException( - 400, "Missing the required parameter 'jobId' when calling getHistoricalJob"); + 400, + "Missing the required parameter 'resourceType' when calling" + + " exportSecurityMonitoringTerraformResource"); + } + + // verify the required parameter 'resourceId' is set + if (resourceId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'resourceId' when calling" + + " exportSecurityMonitoringTerraformResource"); } // create path and map variables String localVarPath = - "/api/v2/siem-historical-detections/jobs/{job_id}" - .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + "/api/v2/security_monitoring/terraform/{resource_type}/{resource_id}" + .replaceAll( + "\\{" + "resource_type" + "\\}", apiClient.escapeString(resourceType.toString())) + .replaceAll( + "\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getHistoricalJob", + "v2.SecurityMonitoringApi.exportSecurityMonitoringTerraformResource", localVarPath, new ArrayList(), localVarHeaderParams, @@ -9158,43 +9007,64 @@ public ApiResponse getHistoricalJobWithHttpInfo(String jo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a job's details. + * Export security monitoring resource to Terraform. * - *

See {@link #getHistoricalJobWithHttpInfo}. + *

See {@link #exportSecurityMonitoringTerraformResourceWithHttpInfo}. * - * @param jobId The ID of the job. (required) - * @return CompletableFuture<ApiResponse<HistoricalJobResponse>> + * @param resourceType The type of security monitoring resource to export. (required) + * @param resourceId The ID of the security monitoring resource to export. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringTerraformExportResponse>> */ - public CompletableFuture> getHistoricalJobWithHttpInfoAsync( - String jobId) { + public CompletableFuture> + exportSecurityMonitoringTerraformResourceWithHttpInfoAsync( + SecurityMonitoringTerraformResourceType resourceType, String resourceId) { // Check if unstable operation is enabled - String operationId = "getHistoricalJob"; + String operationId = "exportSecurityMonitoringTerraformResource"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - // verify the required parameter 'jobId' is set - if (jobId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'resourceType' is set + if (resourceType == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'jobId' when calling getHistoricalJob")); + 400, + "Missing the required parameter 'resourceType' when calling" + + " exportSecurityMonitoringTerraformResource")); + return result; + } + + // verify the required parameter 'resourceId' is set + if (resourceId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'resourceId' when calling" + + " exportSecurityMonitoringTerraformResource")); return result; } // create path and map variables String localVarPath = - "/api/v2/siem-historical-detections/jobs/{job_id}" - .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + "/api/v2/security_monitoring/terraform/{resource_type}/{resource_id}" + .replaceAll( + "\\{" + "resource_type" + "\\}", apiClient.escapeString(resourceType.toString())) + .replaceAll( + "\\{" + "resource_id" + "\\}", apiClient.escapeString(resourceId.toString())); Map localVarHeaderParams = new HashMap(); @@ -9202,7 +9072,7 @@ public CompletableFuture> getHistoricalJobWit try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getHistoricalJob", + "v2.SecurityMonitoringApi.exportSecurityMonitoringTerraformResource", localVarPath, new ArrayList(), localVarHeaderParams, @@ -9210,7 +9080,8 @@ public CompletableFuture> getHistoricalJobWit new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -9222,132 +9093,31 @@ public CompletableFuture> getHistoricalJobWit localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to getIndicatorOfCompromise. */ - public static class GetIndicatorOfCompromiseOptionalParameters { - private Boolean ocsf; - private Boolean includeTriageHistory; - private Integer triageHistoryLimit; - private Integer triageHistoryOffset; - - /** - * Set ocsf. - * - * @param ocsf When true, return only OCSF field-based matches. When false, return - * regex/message-based matches. (optional, default to true) - * @return GetIndicatorOfCompromiseOptionalParameters - */ - public GetIndicatorOfCompromiseOptionalParameters ocsf(Boolean ocsf) { - this.ocsf = ocsf; - return this; - } - - /** - * Set includeTriageHistory. - * - * @param includeTriageHistory Include full triage history for the indicator. (optional, default - * to false) - * @return GetIndicatorOfCompromiseOptionalParameters - */ - public GetIndicatorOfCompromiseOptionalParameters includeTriageHistory( - Boolean includeTriageHistory) { - this.includeTriageHistory = includeTriageHistory; - return this; - } - - /** - * Set triageHistoryLimit. - * - * @param triageHistoryLimit Maximum number of triage history events returned. Only applied when - * include_triage_history is true. (optional, default to 50) - * @return GetIndicatorOfCompromiseOptionalParameters - */ - public GetIndicatorOfCompromiseOptionalParameters triageHistoryLimit( - Integer triageHistoryLimit) { - this.triageHistoryLimit = triageHistoryLimit; - return this; - } - - /** - * Set triageHistoryOffset. - * - * @param triageHistoryOffset Pagination offset into the triage history. Only applied when - * include_triage_history is true. (optional, default to 0) - * @return GetIndicatorOfCompromiseOptionalParameters - */ - public GetIndicatorOfCompromiseOptionalParameters triageHistoryOffset( - Integer triageHistoryOffset) { - this.triageHistoryOffset = triageHistoryOffset; - return this; - } - } - - /** - * Get an indicator of compromise. - * - *

See {@link #getIndicatorOfCompromiseWithHttpInfo}. - * - * @param indicator The indicator value to look up (for example, an IP address or domain). - * (required) - * @return GetIoCIndicatorResponse - * @throws ApiException if fails to make API call - */ - public GetIoCIndicatorResponse getIndicatorOfCompromise(String indicator) throws ApiException { - return getIndicatorOfCompromiseWithHttpInfo( - indicator, new GetIndicatorOfCompromiseOptionalParameters()) - .getData(); - } - - /** - * Get an indicator of compromise. - * - *

See {@link #getIndicatorOfCompromiseWithHttpInfoAsync}. - * - * @param indicator The indicator value to look up (for example, an IP address or domain). - * (required) - * @return CompletableFuture<GetIoCIndicatorResponse> - */ - public CompletableFuture getIndicatorOfCompromiseAsync( - String indicator) { - return getIndicatorOfCompromiseWithHttpInfoAsync( - indicator, new GetIndicatorOfCompromiseOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType() {}); } /** - * Get an indicator of compromise. + * Get content pack states. * - *

See {@link #getIndicatorOfCompromiseWithHttpInfo}. + *

See {@link #getContentPacksStatesWithHttpInfo}. * - * @param indicator The indicator value to look up (for example, an IP address or domain). - * (required) - * @param parameters Optional parameters for the request. - * @return GetIoCIndicatorResponse + * @return SecurityMonitoringContentPackStatesResponse * @throws ApiException if fails to make API call */ - public GetIoCIndicatorResponse getIndicatorOfCompromise( - String indicator, GetIndicatorOfCompromiseOptionalParameters parameters) throws ApiException { - return getIndicatorOfCompromiseWithHttpInfo(indicator, parameters).getData(); + public SecurityMonitoringContentPackStatesResponse getContentPacksStates() throws ApiException { + return getContentPacksStatesWithHttpInfo().getData(); } /** - * Get an indicator of compromise. + * Get content pack states. * - *

See {@link #getIndicatorOfCompromiseWithHttpInfoAsync}. + *

See {@link #getContentPacksStatesWithHttpInfoAsync}. * - * @param indicator The indicator value to look up (for example, an IP address or domain). - * (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<GetIoCIndicatorResponse> + * @return CompletableFuture<SecurityMonitoringContentPackStatesResponse> */ - public CompletableFuture getIndicatorOfCompromiseAsync( - String indicator, GetIndicatorOfCompromiseOptionalParameters parameters) { - return getIndicatorOfCompromiseWithHttpInfoAsync(indicator, parameters) + public CompletableFuture + getContentPacksStatesAsync() { + return getContentPacksStatesWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -9355,64 +9125,41 @@ public CompletableFuture getIndicatorOfCompromiseAsync( } /** - * Get detailed information about a specific indicator of compromise (IoC). + * Get the activation state, integration status, and log collection status for all Cloud SIEM + * content packs. * - * @param indicator The indicator value to look up (for example, an IP address or domain). - * (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<GetIoCIndicatorResponse> + * @return ApiResponse<SecurityMonitoringContentPackStatesResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * + * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getIndicatorOfCompromiseWithHttpInfo( - String indicator, GetIndicatorOfCompromiseOptionalParameters parameters) throws ApiException { + public ApiResponse + getContentPacksStatesWithHttpInfo() throws ApiException { // Check if unstable operation is enabled - String operationId = "getIndicatorOfCompromise"; + String operationId = "getContentPacksStates"; 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 'indicator' is set - if (indicator == null) { - throw new ApiException( - 400, "Missing the required parameter 'indicator' when calling getIndicatorOfCompromise"); - } - Boolean ocsf = parameters.ocsf; - Boolean includeTriageHistory = parameters.includeTriageHistory; - Integer triageHistoryLimit = parameters.triageHistoryLimit; - Integer triageHistoryOffset = parameters.triageHistoryOffset; // create path and map variables - String localVarPath = "/api/v2/security/siem/ioc-explorer/indicator"; + String localVarPath = "/api/v2/security_monitoring/content_packs/states"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "indicator", indicator)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "ocsf", ocsf)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "include_triage_history", includeTriageHistory)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "triage_history_limit", triageHistoryLimit)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "triage_history_offset", triageHistoryOffset)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getIndicatorOfCompromise", + "v2.SecurityMonitoringApi.getContentPacksStates", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -9425,75 +9172,49 @@ public ApiResponse getIndicatorOfCompromiseWithHttpInfo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get an indicator of compromise. + * Get content pack states. * - *

See {@link #getIndicatorOfCompromiseWithHttpInfo}. + *

See {@link #getContentPacksStatesWithHttpInfo}. * - * @param indicator The indicator value to look up (for example, an IP address or domain). - * (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<GetIoCIndicatorResponse>> + * @return CompletableFuture<ApiResponse<SecurityMonitoringContentPackStatesResponse>> */ - public CompletableFuture> - getIndicatorOfCompromiseWithHttpInfoAsync( - String indicator, GetIndicatorOfCompromiseOptionalParameters parameters) { + public CompletableFuture> + getContentPacksStatesWithHttpInfoAsync() { // Check if unstable operation is enabled - String operationId = "getIndicatorOfCompromise"; + String operationId = "getContentPacksStates"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - - // verify the required parameter 'indicator' is set - if (indicator == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'indicator' when calling getIndicatorOfCompromise")); - return result; - } - Boolean ocsf = parameters.ocsf; - Boolean includeTriageHistory = parameters.includeTriageHistory; - Integer triageHistoryLimit = parameters.triageHistoryLimit; - Integer triageHistoryOffset = parameters.triageHistoryOffset; // create path and map variables - String localVarPath = "/api/v2/security/siem/ioc-explorer/indicator"; + String localVarPath = "/api/v2/security_monitoring/content_packs/states"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "indicator", indicator)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "ocsf", ocsf)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "include_triage_history", includeTriageHistory)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "triage_history_limit", triageHistoryLimit)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "triage_history_offset", triageHistoryOffset)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getIndicatorOfCompromise", + "v2.SecurityMonitoringApi.getContentPacksStates", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -9505,34 +9226,34 @@ public ApiResponse getIndicatorOfCompromiseWithHttpInfo localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get investigation queries for a signal. + * Get critical assets affecting a specific rule. * - *

See {@link #getInvestigationLogQueriesMatchingSignalWithHttpInfo}. + *

See {@link #getCriticalAssetsAffectingRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @return SecurityMonitoringSignalSuggestedActionsResponse + * @param ruleId The ID of the rule. (required) + * @return SecurityMonitoringCriticalAssetsResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueriesMatchingSignal( - String signalId) throws ApiException { - return getInvestigationLogQueriesMatchingSignalWithHttpInfo(signalId).getData(); + public SecurityMonitoringCriticalAssetsResponse getCriticalAssetsAffectingRule(String ruleId) + throws ApiException { + return getCriticalAssetsAffectingRuleWithHttpInfo(ruleId).getData(); } /** - * Get investigation queries for a signal. + * Get critical assets affecting a specific rule. * - *

See {@link #getInvestigationLogQueriesMatchingSignalWithHttpInfoAsync}. + *

See {@link #getCriticalAssetsAffectingRuleWithHttpInfoAsync}. * - * @param signalId The ID of the signal. (required) - * @return CompletableFuture<SecurityMonitoringSignalSuggestedActionsResponse> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<SecurityMonitoringCriticalAssetsResponse> */ - public CompletableFuture - getInvestigationLogQueriesMatchingSignalAsync(String signalId) { - return getInvestigationLogQueriesMatchingSignalWithHttpInfoAsync(signalId) + public CompletableFuture + getCriticalAssetsAffectingRuleAsync(String ruleId) { + return getCriticalAssetsAffectingRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -9540,10 +9261,10 @@ public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueri } /** - * Get the list of investigation log queries available for a given security signal. + * Get the list of critical assets that affect a specific existing rule by the rule's ID. * - * @param signalId The ID of the signal. (required) - * @return ApiResponse<SecurityMonitoringSignalSuggestedActionsResponse> + * @param ruleId The ID of the rule. (required) + * @return ApiResponse<SecurityMonitoringCriticalAssetsResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -9555,27 +9276,26 @@ public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueri * *
429 Too many requests -
*/ - public ApiResponse - getInvestigationLogQueriesMatchingSignalWithHttpInfo(String signalId) throws ApiException { + public ApiResponse + getCriticalAssetsAffectingRuleWithHttpInfo(String ruleId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'signalId' is set - if (signalId == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( 400, - "Missing the required parameter 'signalId' when calling" - + " getInvestigationLogQueriesMatchingSignal"); + "Missing the required parameter 'ruleId' when calling getCriticalAssetsAffectingRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/investigation_queries" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security_monitoring/configuration/critical_assets/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getInvestigationLogQueriesMatchingSignal", + "v2.SecurityMonitoringApi.getCriticalAssetsAffectingRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -9590,37 +9310,36 @@ public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueri localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get investigation queries for a signal. + * Get critical assets affecting a specific rule. * - *

See {@link #getInvestigationLogQueriesMatchingSignalWithHttpInfo}. + *

See {@link #getCriticalAssetsAffectingRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringSignalSuggestedActionsResponse>> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringCriticalAssetsResponse>> */ - public CompletableFuture> - getInvestigationLogQueriesMatchingSignalWithHttpInfoAsync(String signalId) { + public CompletableFuture> + getCriticalAssetsAffectingRuleWithHttpInfoAsync(String ruleId) { Object localVarPostBody = null; - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture> result = + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'signalId' when calling" - + " getInvestigationLogQueriesMatchingSignal")); + "Missing the required parameter 'ruleId' when calling" + + " getCriticalAssetsAffectingRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/investigation_queries" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security_monitoring/configuration/critical_assets/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -9628,7 +9347,7 @@ public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueri try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getInvestigationLogQueriesMatchingSignal", + "v2.SecurityMonitoringApi.getCriticalAssetsAffectingRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -9636,7 +9355,7 @@ public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueri new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -9649,76 +9368,36 @@ public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueri localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to getResourceEvaluationFilters. */ - public static class GetResourceEvaluationFiltersOptionalParameters { - private String cloudProvider; - private String accountId; - private Boolean skipCache; - - /** - * Set cloudProvider. - * - * @param cloudProvider Filter resource filters by cloud provider (e.g. aws, gcp, azure). - * (optional) - * @return GetResourceEvaluationFiltersOptionalParameters - */ - public GetResourceEvaluationFiltersOptionalParameters cloudProvider(String cloudProvider) { - this.cloudProvider = cloudProvider; - return this; - } - - /** - * Set accountId. - * - * @param accountId Filter resource filters by cloud provider account ID. This parameter is only - * valid when provider is specified. (optional) - * @return GetResourceEvaluationFiltersOptionalParameters - */ - public GetResourceEvaluationFiltersOptionalParameters accountId(String accountId) { - this.accountId = accountId; - return this; - } - - /** - * Set skipCache. - * - * @param skipCache Skip cache for resource filters. (optional) - * @return GetResourceEvaluationFiltersOptionalParameters - */ - public GetResourceEvaluationFiltersOptionalParameters skipCache(Boolean skipCache) { - this.skipCache = skipCache; - return this; - } + new GenericType() {}); } /** - * List resource filters. + * Get a custom framework. * - *

See {@link #getResourceEvaluationFiltersWithHttpInfo}. + *

See {@link #getCustomFrameworkWithHttpInfo}. * - * @return GetResourceEvaluationFiltersResponse + * @param handle The framework handle (required) + * @param version The framework version (required) + * @return GetCustomFrameworkResponse * @throws ApiException if fails to make API call */ - public GetResourceEvaluationFiltersResponse getResourceEvaluationFilters() throws ApiException { - return getResourceEvaluationFiltersWithHttpInfo( - new GetResourceEvaluationFiltersOptionalParameters()) - .getData(); + public GetCustomFrameworkResponse getCustomFramework(String handle, String version) + throws ApiException { + return getCustomFrameworkWithHttpInfo(handle, version).getData(); } /** - * List resource filters. + * Get a custom framework. * - *

See {@link #getResourceEvaluationFiltersWithHttpInfoAsync}. + *

See {@link #getCustomFrameworkWithHttpInfoAsync}. * - * @return CompletableFuture<GetResourceEvaluationFiltersResponse> + * @param handle The framework handle (required) + * @param version The framework version (required) + * @return CompletableFuture<GetCustomFrameworkResponse> */ - public CompletableFuture - getResourceEvaluationFiltersAsync() { - return getResourceEvaluationFiltersWithHttpInfoAsync( - new GetResourceEvaluationFiltersOptionalParameters()) + public CompletableFuture getCustomFrameworkAsync( + String handle, String version) { + return getCustomFrameworkWithHttpInfoAsync(handle, version) .thenApply( response -> { return response.getData(); @@ -9726,41 +9405,11 @@ public GetResourceEvaluationFiltersResponse getResourceEvaluationFilters() throw } /** - * List resource filters. - * - *

See {@link #getResourceEvaluationFiltersWithHttpInfo}. + * Get a custom framework. * - * @param parameters Optional parameters for the request. - * @return GetResourceEvaluationFiltersResponse - * @throws ApiException if fails to make API call - */ - public GetResourceEvaluationFiltersResponse getResourceEvaluationFilters( - GetResourceEvaluationFiltersOptionalParameters parameters) throws ApiException { - return getResourceEvaluationFiltersWithHttpInfo(parameters).getData(); - } - - /** - * List resource filters. - * - *

See {@link #getResourceEvaluationFiltersWithHttpInfoAsync}. - * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<GetResourceEvaluationFiltersResponse> - */ - public CompletableFuture getResourceEvaluationFiltersAsync( - GetResourceEvaluationFiltersOptionalParameters parameters) { - return getResourceEvaluationFiltersWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * List resource filters. - * - * @param parameters Optional parameters for the request. - * @return ApiResponse<GetResourceEvaluationFiltersResponse> + * @param handle The framework handle (required) + * @param version The framework version (required) + * @return ApiResponse<GetCustomFrameworkResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -9768,31 +9417,38 @@ public CompletableFuture getResourceEvalua * * * - * * + * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
500 Bad Request -
*/ - public ApiResponse getResourceEvaluationFiltersWithHttpInfo( - GetResourceEvaluationFiltersOptionalParameters parameters) throws ApiException { + public ApiResponse getCustomFrameworkWithHttpInfo( + String handle, String version) throws ApiException { Object localVarPostBody = null; - String cloudProvider = parameters.cloudProvider; - String accountId = parameters.accountId; - Boolean skipCache = parameters.skipCache; + + // verify the required parameter 'handle' is set + if (handle == null) { + throw new ApiException( + 400, "Missing the required parameter 'handle' when calling getCustomFramework"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + 400, "Missing the required parameter 'version' when calling getCustomFramework"); + } // create path and map variables - String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + String localVarPath = + "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" + .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud_provider", cloudProvider)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip_cache", skipCache)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getResourceEvaluationFilters", + "v2.SecurityMonitoringApi.getCustomFramework", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -9805,48 +9461,60 @@ public ApiResponse getResourceEvaluationFi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List resource filters. + * Get a custom framework. * - *

See {@link #getResourceEvaluationFiltersWithHttpInfo}. + *

See {@link #getCustomFrameworkWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<GetResourceEvaluationFiltersResponse>> + * @param handle The framework handle (required) + * @param version The framework version (required) + * @return CompletableFuture<ApiResponse<GetCustomFrameworkResponse>> */ - public CompletableFuture> - getResourceEvaluationFiltersWithHttpInfoAsync( - GetResourceEvaluationFiltersOptionalParameters parameters) { + public CompletableFuture> + getCustomFrameworkWithHttpInfoAsync(String handle, String version) { Object localVarPostBody = null; - String cloudProvider = parameters.cloudProvider; - String accountId = parameters.accountId; - Boolean skipCache = parameters.skipCache; + + // verify the required parameter 'handle' is set + if (handle == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'handle' when calling getCustomFramework")); + return result; + } + + // verify the required parameter 'version' is set + if (version == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'version' when calling getCustomFramework")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + String localVarPath = + "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" + .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud_provider", cloudProvider)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip_cache", skipCache)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getResourceEvaluationFilters", + "v2.SecurityMonitoringApi.getCustomFramework", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -9858,64 +9526,115 @@ public ApiResponse getResourceEvaluationFi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to getRuleVersionHistory. */ - public static class GetRuleVersionHistoryOptionalParameters { - private Long pageSize; - private Long pageNumber; + /** Manage optional parameters to getEntityContext. */ + public static class GetEntityContextOptionalParameters { + private String query; + private String from; + private String to; + private String asOf; + private Long limit; + private String pageToken; /** - * Set pageSize. + * Set query. * - * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default - * to 10) - * @return GetRuleVersionHistoryOptionalParameters + * @param query A free-text query (for example, an email address or principal ID) used to filter + * the entities returned. (optional) + * @return GetEntityContextOptionalParameters */ - public GetRuleVersionHistoryOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; + public GetEntityContextOptionalParameters query(String query) { + this.query = query; return this; } /** - * Set pageNumber. + * Set from. * - * @param pageNumber Specific page number to return. (optional, default to 0) - * @return GetRuleVersionHistoryOptionalParameters + * @param from The start of the time range to query, as an RFC3339 timestamp or a relative time + * (for example, now-7d). Defaults to now-7d. Ignored when + * as_of is set. (optional, default to "now-7d") + * @return GetEntityContextOptionalParameters */ - public GetRuleVersionHistoryOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; + public GetEntityContextOptionalParameters from(String from) { + this.from = from; + return this; + } + + /** + * Set to. + * + * @param to The end of the time range to query, as an RFC3339 timestamp or a relative time (for + * example, now). Defaults to now. Ignored when as_of + * is set. (optional, default to "now") + * @return GetEntityContextOptionalParameters + */ + public GetEntityContextOptionalParameters to(String to) { + this.to = to; + return this; + } + + /** + * Set asOf. + * + * @param asOf A point in time at which to query the entity revisions, as an RFC3339 timestamp, + * a Unix timestamp (in seconds), or a relative time (for example, now-1d). + * When set, from and to are ignored. Cannot be combined with + * custom from / to values. (optional) + * @return GetEntityContextOptionalParameters + */ + public GetEntityContextOptionalParameters asOf(String asOf) { + this.asOf = asOf; + return this; + } + + /** + * Set limit. + * + * @param limit The maximum number of entities to return. (optional, default to 250) + * @return GetEntityContextOptionalParameters + */ + public GetEntityContextOptionalParameters limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Set pageToken. + * + * @param pageToken An opaque token used to fetch the next page of results, as returned in + * meta.page.next_token of a previous response. (optional) + * @return GetEntityContextOptionalParameters + */ + public GetEntityContextOptionalParameters pageToken(String pageToken) { + this.pageToken = pageToken; return this; } } /** - * Get a rule's version history. + * Get entity context. * - *

See {@link #getRuleVersionHistoryWithHttpInfo}. + *

See {@link #getEntityContextWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @return GetRuleVersionHistoryResponse + * @return EntityContextResponse * @throws ApiException if fails to make API call */ - public GetRuleVersionHistoryResponse getRuleVersionHistory(String ruleId) throws ApiException { - return getRuleVersionHistoryWithHttpInfo(ruleId, new GetRuleVersionHistoryOptionalParameters()) - .getData(); + public EntityContextResponse getEntityContext() throws ApiException { + return getEntityContextWithHttpInfo(new GetEntityContextOptionalParameters()).getData(); } /** - * Get a rule's version history. + * Get entity context. * - *

See {@link #getRuleVersionHistoryWithHttpInfoAsync}. + *

See {@link #getEntityContextWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) - * @return CompletableFuture<GetRuleVersionHistoryResponse> + * @return CompletableFuture<EntityContextResponse> */ - public CompletableFuture getRuleVersionHistoryAsync( - String ruleId) { - return getRuleVersionHistoryWithHttpInfoAsync( - ruleId, new GetRuleVersionHistoryOptionalParameters()) + public CompletableFuture getEntityContextAsync() { + return getEntityContextWithHttpInfoAsync(new GetEntityContextOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -9923,32 +9642,30 @@ ruleId, new GetRuleVersionHistoryOptionalParameters()) } /** - * Get a rule's version history. + * Get entity context. * - *

See {@link #getRuleVersionHistoryWithHttpInfo}. + *

See {@link #getEntityContextWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) * @param parameters Optional parameters for the request. - * @return GetRuleVersionHistoryResponse + * @return EntityContextResponse * @throws ApiException if fails to make API call */ - public GetRuleVersionHistoryResponse getRuleVersionHistory( - String ruleId, GetRuleVersionHistoryOptionalParameters parameters) throws ApiException { - return getRuleVersionHistoryWithHttpInfo(ruleId, parameters).getData(); + public EntityContextResponse getEntityContext(GetEntityContextOptionalParameters parameters) + throws ApiException { + return getEntityContextWithHttpInfo(parameters).getData(); } /** - * Get a rule's version history. + * Get entity context. * - *

See {@link #getRuleVersionHistoryWithHttpInfoAsync}. + *

See {@link #getEntityContextWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<GetRuleVersionHistoryResponse> + * @return CompletableFuture<EntityContextResponse> */ - public CompletableFuture getRuleVersionHistoryAsync( - String ruleId, GetRuleVersionHistoryOptionalParameters parameters) { - return getRuleVersionHistoryWithHttpInfoAsync(ruleId, parameters) + public CompletableFuture getEntityContextAsync( + GetEntityContextOptionalParameters parameters) { + return getEntityContextWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -9956,11 +9673,13 @@ public CompletableFuture getRuleVersionHistoryAsy } /** - * Get a rule's version history. + * Search the Cloud SIEM entity context store for entities that match a query, and return the + * historical revisions of each entity in the requested time range. The endpoint can either return + * revisions across an interval (from / to) or the snapshot of each + * entity at a single point in time (as_of); the two modes are mutually exclusive. * - * @param ruleId The ID of the rule. (required) * @param parameters Optional parameters for the request. - * @return ApiResponse<GetRuleVersionHistoryResponse> + * @return ApiResponse<EntityContextResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -9969,48 +9688,47 @@ public CompletableFuture getRuleVersionHistoryAsy * * * - * * *
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getRuleVersionHistoryWithHttpInfo( - String ruleId, GetRuleVersionHistoryOptionalParameters parameters) throws ApiException { + public ApiResponse getEntityContextWithHttpInfo( + GetEntityContextOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "getRuleVersionHistory"; + String operationId = "getEntityContext"; 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 'ruleId' is set - if (ruleId == null) { - throw new ApiException( - 400, "Missing the required parameter 'ruleId' when calling getRuleVersionHistory"); - } - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; + String query = parameters.query; + String from = parameters.from; + String to = parameters.to; + String asOf = parameters.asOf; + Long limit = parameters.limit; + String pageToken = parameters.pageToken; // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}/version_history" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + String localVarPath = "/api/v2/security_monitoring/entity_context"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_token", pageToken)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getRuleVersionHistory", + "v2.SecurityMonitoringApi.getEntityContext", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", builder, @@ -10019,70 +9737,62 @@ public ApiResponse getRuleVersionHistoryWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a rule's version history. + * Get entity context. * - *

See {@link #getRuleVersionHistoryWithHttpInfo}. + *

See {@link #getEntityContextWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<GetRuleVersionHistoryResponse>> + * @return CompletableFuture<ApiResponse<EntityContextResponse>> */ - public CompletableFuture> - getRuleVersionHistoryWithHttpInfoAsync( - String ruleId, GetRuleVersionHistoryOptionalParameters parameters) { + public CompletableFuture> getEntityContextWithHttpInfoAsync( + GetEntityContextOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "getRuleVersionHistory"; + String operationId = "getEntityContext"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - - // verify the required parameter 'ruleId' is set - if (ruleId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'ruleId' when calling getRuleVersionHistory")); - return result; - } - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; + String query = parameters.query; + String from = parameters.from; + String to = parameters.to; + String asOf = parameters.asOf; + Long limit = parameters.limit; + String pageToken = parameters.pageToken; // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}/version_history" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + String localVarPath = "/api/v2/security_monitoring/entity_context"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page_token", pageToken)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getRuleVersionHistory", + "v2.SecurityMonitoringApi.getEntityContext", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -10094,65 +9804,49 @@ public ApiResponse getRuleVersionHistoryWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to getSBOM. */ - public static class GetSBOMOptionalParameters { - private String filterRepoDigest; - private SBOMFormat extFormat; - - /** - * Set filterRepoDigest. - * - * @param filterRepoDigest The container image repo_digest for the SBOM request. - * When the requested asset type is 'Image', this filter is mandatory. (optional) - * @return GetSBOMOptionalParameters - */ - public GetSBOMOptionalParameters filterRepoDigest(String filterRepoDigest) { - this.filterRepoDigest = filterRepoDigest; - return this; - } + /** Manage optional parameters to getFinding. */ + public static class GetFindingOptionalParameters { + private Long snapshotTimestamp; /** - * Set extFormat. + * Set snapshotTimestamp. * - * @param extFormat The standard of the SBOM. (optional) - * @return GetSBOMOptionalParameters + * @param snapshotTimestamp Return the finding for a given snapshot of time (Unix ms). + * (optional) + * @return GetFindingOptionalParameters */ - public GetSBOMOptionalParameters extFormat(SBOMFormat extFormat) { - this.extFormat = extFormat; + public GetFindingOptionalParameters snapshotTimestamp(Long snapshotTimestamp) { + this.snapshotTimestamp = snapshotTimestamp; return this; } } /** - * Get SBOM. + * Get a finding. * - *

See {@link #getSBOMWithHttpInfo}. + *

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

See {@link #getSBOMWithHttpInfoAsync}. + *

See {@link #getFindingWithHttpInfoAsync}. * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) - * @return CompletableFuture<GetSBOMResponse> + * @param findingId The ID of the finding. (required) + * @return CompletableFuture<GetFindingResponse> */ - public CompletableFuture getSBOMAsync( - AssetType assetType, String filterAssetName) { - return getSBOMWithHttpInfoAsync(assetType, filterAssetName, new GetSBOMOptionalParameters()) + public CompletableFuture getFindingAsync(String findingId) { + return getFindingWithHttpInfoAsync(findingId, new GetFindingOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -10160,35 +9854,32 @@ public CompletableFuture getSBOMAsync( } /** - * Get SBOM. + * Get a finding. * - *

See {@link #getSBOMWithHttpInfo}. + *

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

See {@link #getSBOMWithHttpInfoAsync}. + *

See {@link #getFindingWithHttpInfoAsync}. * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) + * @param findingId The ID of the finding. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<GetSBOMResponse> + * @return CompletableFuture<GetFindingResponse> */ - public CompletableFuture getSBOMAsync( - AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) { - return getSBOMWithHttpInfoAsync(assetType, filterAssetName, parameters) + public CompletableFuture getFindingAsync( + String findingId, GetFindingOptionalParameters parameters) { + return getFindingWithHttpInfoAsync(findingId, parameters) .thenApply( response -> { return response.getData(); @@ -10196,65 +9887,60 @@ public CompletableFuture getSBOMAsync( } /** - * Get a single SBOM related to an asset by its type and name. + * Returns a single finding with message and resource configuration. * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) + * @param findingId The ID of the finding. (required) * @param parameters Optional parameters for the request. - * @return ApiResponse<GetSBOMResponse> + * @return ApiResponse<GetFindingResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * + * * - * - * + * + * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
400 Bad Request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: asset not found -
429 Too many requests -
404 Not Found: The requested finding cannot be found. -
429 Too many requests: The rate limit set by the API has been exceeded. -
*/ - public ApiResponse getSBOMWithHttpInfo( - AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) - throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'assetType' is set - if (assetType == null) { - throw new ApiException( - 400, "Missing the required parameter 'assetType' when calling getSBOM"); + public ApiResponse 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 'filterAssetName' is set - if (filterAssetName == null) { + // verify the required parameter 'findingId' is set + if (findingId == null) { throw new ApiException( - 400, "Missing the required parameter 'filterAssetName' when calling getSBOM"); + 400, "Missing the required parameter 'findingId' when calling getFinding"); } - String filterRepoDigest = parameters.filterRepoDigest; - SBOMFormat extFormat = parameters.extFormat; + Long snapshotTimestamp = parameters.snapshotTimestamp; // create path and map variables String localVarPath = - "/api/v2/security/sboms/{asset_type}" - .replaceAll("\\{" + "asset_type" + "\\}", apiClient.escapeString(assetType.toString())); + "/api/v2/posture_management/findings/{finding_id}" + .replaceAll("\\{" + "finding_id" + "\\}", apiClient.escapeString(findingId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "ext:format", extFormat)); + apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSBOM", + "v2.SecurityMonitoringApi.getFinding", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", builder, @@ -10263,68 +9949,65 @@ public ApiResponse getSBOMWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get SBOM. + * Get a finding. * - *

See {@link #getSBOMWithHttpInfo}. + *

See {@link #getFindingWithHttpInfo}. * - * @param assetType The type of the asset for the SBOM request. (required) - * @param filterAssetName The name of the asset for the SBOM request. (required) + * @param findingId The ID of the finding. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<GetSBOMResponse>> + * @return CompletableFuture<ApiResponse<GetFindingResponse>> */ - public CompletableFuture> getSBOMWithHttpInfoAsync( - AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) { - Object localVarPostBody = null; - - // verify the required parameter 'assetType' is set - if (assetType == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(400, "Missing the required parameter 'assetType' when calling getSBOM")); + public CompletableFuture> 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> 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 'filterAssetName' is set - if (filterAssetName == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'findingId' is set + if (findingId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'filterAssetName' when calling getSBOM")); + 400, "Missing the required parameter 'findingId' when calling getFinding")); return result; } - String filterRepoDigest = parameters.filterRepoDigest; - SBOMFormat extFormat = parameters.extFormat; + Long snapshotTimestamp = parameters.snapshotTimestamp; // create path and map variables String localVarPath = - "/api/v2/security/sboms/{asset_type}" - .replaceAll("\\{" + "asset_type" + "\\}", apiClient.escapeString(assetType.toString())); + "/api/v2/posture_management/findings/{finding_id}" + .replaceAll("\\{" + "finding_id" + "\\}", apiClient.escapeString(findingId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "ext:format", extFormat)); + apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSBOM", + "v2.SecurityMonitoringApi.getFinding", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -10336,30 +10019,32 @@ public CompletableFuture> getSBOMWithHttpInfoAsync( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Returns a list of Secrets rules. + * Get a job's details. * - *

See {@link #getSecretsRulesWithHttpInfo}. + *

See {@link #getHistoricalJobWithHttpInfo}. * - * @return SecretRuleArray + * @param jobId The ID of the job. (required) + * @return HistoricalJobResponse * @throws ApiException if fails to make API call */ - public SecretRuleArray getSecretsRules() throws ApiException { - return getSecretsRulesWithHttpInfo().getData(); + public HistoricalJobResponse getHistoricalJob(String jobId) throws ApiException { + return getHistoricalJobWithHttpInfo(jobId).getData(); } /** - * Returns a list of Secrets rules. + * Get a job's details. * - *

See {@link #getSecretsRulesWithHttpInfoAsync}. + *

See {@link #getHistoricalJobWithHttpInfoAsync}. * - * @return CompletableFuture<SecretRuleArray> + * @param jobId The ID of the job. (required) + * @return CompletableFuture<HistoricalJobResponse> */ - public CompletableFuture getSecretsRulesAsync() { - return getSecretsRulesWithHttpInfoAsync() + public CompletableFuture getHistoricalJobAsync(String jobId) { + return getHistoricalJobWithHttpInfoAsync(jobId) .thenApply( response -> { return response.getData(); @@ -10367,35 +10052,48 @@ public CompletableFuture getSecretsRulesAsync() { } /** - * Returns a list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID. + * Get a job's details. * - * @return ApiResponse<SecretRuleArray> + * @param jobId The ID of the job. (required) + * @return ApiResponse<HistoricalJobResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSecretsRulesWithHttpInfo() throws ApiException { + public ApiResponse getHistoricalJobWithHttpInfo(String jobId) + throws ApiException { // Check if unstable operation is enabled - String operationId = "getSecretsRules"; + 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/static-analysis/secrets/rules"; + String localVarPath = + "/api/v2/siem-historical-detections/jobs/{job_id}" + .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecretsRules", + "v2.SecurityMonitoringApi.getHistoricalJob", localVarPath, new ArrayList(), localVarHeaderParams, @@ -10410,30 +10108,43 @@ public ApiResponse getSecretsRulesWithHttpInfo() throws ApiExce localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Returns a list of Secrets rules. + * Get a job's details. * - *

See {@link #getSecretsRulesWithHttpInfo}. + *

See {@link #getHistoricalJobWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<SecretRuleArray>> + * @param jobId The ID of the job. (required) + * @return CompletableFuture<ApiResponse<HistoricalJobResponse>> */ - public CompletableFuture> getSecretsRulesWithHttpInfoAsync() { + public CompletableFuture> getHistoricalJobWithHttpInfoAsync( + String jobId) { // Check if unstable operation is enabled - String operationId = "getSecretsRules"; + String operationId = "getHistoricalJob"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; + + // verify the required parameter 'jobId' is set + if (jobId == null) { + CompletableFuture> 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/static-analysis/secrets/rules"; + String localVarPath = + "/api/v2/siem-historical-detections/jobs/{job_id}" + .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); Map localVarHeaderParams = new HashMap(); @@ -10441,7 +10152,7 @@ public CompletableFuture> getSecretsRulesWithHttpIn try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecretsRules", + "v2.SecurityMonitoringApi.getHistoricalJob", localVarPath, new ArrayList(), localVarHeaderParams, @@ -10449,7 +10160,7 @@ public CompletableFuture> getSecretsRulesWithHttpIn new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -10461,32 +10172,97 @@ public CompletableFuture> getSecretsRulesWithHttpIn localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getIndicatorOfCompromise. */ + public static class GetIndicatorOfCompromiseOptionalParameters { + private Boolean ocsf; + private Boolean includeTriageHistory; + private Integer triageHistoryLimit; + private Integer triageHistoryOffset; + + /** + * Set ocsf. + * + * @param ocsf When true, return only OCSF field-based matches. When false, return + * regex/message-based matches. (optional, default to true) + * @return GetIndicatorOfCompromiseOptionalParameters + */ + public GetIndicatorOfCompromiseOptionalParameters ocsf(Boolean ocsf) { + this.ocsf = ocsf; + return this; + } + + /** + * Set includeTriageHistory. + * + * @param includeTriageHistory Include full triage history for the indicator. (optional, default + * to false) + * @return GetIndicatorOfCompromiseOptionalParameters + */ + public GetIndicatorOfCompromiseOptionalParameters includeTriageHistory( + Boolean includeTriageHistory) { + this.includeTriageHistory = includeTriageHistory; + return this; + } + + /** + * Set triageHistoryLimit. + * + * @param triageHistoryLimit Maximum number of triage history events returned. Only applied when + * include_triage_history is true. (optional, default to 50) + * @return GetIndicatorOfCompromiseOptionalParameters + */ + public GetIndicatorOfCompromiseOptionalParameters triageHistoryLimit( + Integer triageHistoryLimit) { + this.triageHistoryLimit = triageHistoryLimit; + return this; + } + + /** + * Set triageHistoryOffset. + * + * @param triageHistoryOffset Pagination offset into the triage history. Only applied when + * include_triage_history is true. (optional, default to 0) + * @return GetIndicatorOfCompromiseOptionalParameters + */ + public GetIndicatorOfCompromiseOptionalParameters triageHistoryOffset( + Integer triageHistoryOffset) { + this.triageHistoryOffset = triageHistoryOffset; + return this; + } } /** - * Get a security filter. + * Get an indicator of compromise. * - *

See {@link #getSecurityFilterWithHttpInfo}. + *

See {@link #getIndicatorOfCompromiseWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) - * @return SecurityFilterResponse + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @return GetIoCIndicatorResponse * @throws ApiException if fails to make API call */ - public SecurityFilterResponse getSecurityFilter(String securityFilterId) throws ApiException { - return getSecurityFilterWithHttpInfo(securityFilterId).getData(); + public GetIoCIndicatorResponse getIndicatorOfCompromise(String indicator) throws ApiException { + return getIndicatorOfCompromiseWithHttpInfo( + indicator, new GetIndicatorOfCompromiseOptionalParameters()) + .getData(); } /** - * Get a security filter. + * Get an indicator of compromise. * - *

See {@link #getSecurityFilterWithHttpInfoAsync}. + *

See {@link #getIndicatorOfCompromiseWithHttpInfoAsync}. * - * @param securityFilterId The ID of the security filter. (required) - * @return CompletableFuture<SecurityFilterResponse> + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @return CompletableFuture<GetIoCIndicatorResponse> */ - public CompletableFuture getSecurityFilterAsync(String securityFilterId) { - return getSecurityFilterWithHttpInfoAsync(securityFilterId) + public CompletableFuture getIndicatorOfCompromiseAsync( + String indicator) { + return getIndicatorOfCompromiseWithHttpInfoAsync( + indicator, new GetIndicatorOfCompromiseOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -10494,48 +10270,99 @@ public CompletableFuture getSecurityFilterAsync(String s } /** - * Get the details of a specific security filter. + * Get an indicator of compromise. * - *

See the security - * filter guide for more examples. + *

See {@link #getIndicatorOfCompromiseWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) - * @return ApiResponse<SecurityFilterResponse> + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @param parameters Optional parameters for the request. + * @return GetIoCIndicatorResponse + * @throws ApiException if fails to make API call + */ + public GetIoCIndicatorResponse getIndicatorOfCompromise( + String indicator, GetIndicatorOfCompromiseOptionalParameters parameters) throws ApiException { + return getIndicatorOfCompromiseWithHttpInfo(indicator, parameters).getData(); + } + + /** + * Get an indicator of compromise. + * + *

See {@link #getIndicatorOfCompromiseWithHttpInfoAsync}. + * + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<GetIoCIndicatorResponse> + */ + public CompletableFuture getIndicatorOfCompromiseAsync( + String indicator, GetIndicatorOfCompromiseOptionalParameters parameters) { + return getIndicatorOfCompromiseWithHttpInfoAsync(indicator, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get detailed information about a specific indicator of compromise (IoC). + * + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<GetIoCIndicatorResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSecurityFilterWithHttpInfo(String securityFilterId) - throws ApiException { + public ApiResponse getIndicatorOfCompromiseWithHttpInfo( + String indicator, GetIndicatorOfCompromiseOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getIndicatorOfCompromise"; + 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 'securityFilterId' is set - if (securityFilterId == null) { + // verify the required parameter 'indicator' is set + if (indicator == null) { throw new ApiException( - 400, "Missing the required parameter 'securityFilterId' when calling getSecurityFilter"); + 400, "Missing the required parameter 'indicator' when calling getIndicatorOfCompromise"); } + Boolean ocsf = parameters.ocsf; + Boolean includeTriageHistory = parameters.includeTriageHistory; + Integer triageHistoryLimit = parameters.triageHistoryLimit; + Integer triageHistoryOffset = parameters.triageHistoryOffset; // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + String localVarPath = "/api/v2/security/siem/ioc-explorer/indicator"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "indicator", indicator)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "ocsf", ocsf)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "include_triage_history", includeTriageHistory)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "triage_history_limit", triageHistoryLimit)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "triage_history_offset", triageHistoryOffset)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityFilter", + "v2.SecurityMonitoringApi.getIndicatorOfCompromise", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -10548,52 +10375,75 @@ public ApiResponse getSecurityFilterWithHttpInfo(String localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a security filter. + * Get an indicator of compromise. * - *

See {@link #getSecurityFilterWithHttpInfo}. + *

See {@link #getIndicatorOfCompromiseWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) - * @return CompletableFuture<ApiResponse<SecurityFilterResponse>> + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<GetIoCIndicatorResponse>> */ - public CompletableFuture> getSecurityFilterWithHttpInfoAsync( - String securityFilterId) { + public CompletableFuture> + getIndicatorOfCompromiseWithHttpInfoAsync( + String indicator, GetIndicatorOfCompromiseOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getIndicatorOfCompromise"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - // verify the required parameter 'securityFilterId' is set - if (securityFilterId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'indicator' is set + if (indicator == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'securityFilterId' when calling getSecurityFilter")); + "Missing the required parameter 'indicator' when calling getIndicatorOfCompromise")); return result; } + Boolean ocsf = parameters.ocsf; + Boolean includeTriageHistory = parameters.includeTriageHistory; + Integer triageHistoryLimit = parameters.triageHistoryLimit; + Integer triageHistoryOffset = parameters.triageHistoryOffset; // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + String localVarPath = "/api/v2/security/siem/ioc-explorer/indicator"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "indicator", indicator)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "ocsf", ocsf)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "include_triage_history", includeTriageHistory)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "triage_history_limit", triageHistoryLimit)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "triage_history_offset", triageHistoryOffset)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityFilter", + "v2.SecurityMonitoringApi.getIndicatorOfCompromise", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -10605,34 +10455,34 @@ public CompletableFuture> getSecurityFilterW localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a critical asset. + * Get investigation queries for a signal. * - *

See {@link #getSecurityMonitoringCriticalAssetWithHttpInfo}. + *

See {@link #getInvestigationLogQueriesMatchingSignalWithHttpInfo}. * - * @param criticalAssetId The ID of the critical asset. (required) - * @return SecurityMonitoringCriticalAssetResponse + * @param signalId The ID of the signal. (required) + * @return SecurityMonitoringSignalSuggestedActionsResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringCriticalAssetResponse getSecurityMonitoringCriticalAsset( - String criticalAssetId) throws ApiException { - return getSecurityMonitoringCriticalAssetWithHttpInfo(criticalAssetId).getData(); + public SecurityMonitoringSignalSuggestedActionsResponse getInvestigationLogQueriesMatchingSignal( + String signalId) throws ApiException { + return getInvestigationLogQueriesMatchingSignalWithHttpInfo(signalId).getData(); } /** - * Get a critical asset. + * Get investigation queries for a signal. * - *

See {@link #getSecurityMonitoringCriticalAssetWithHttpInfoAsync}. + *

See {@link #getInvestigationLogQueriesMatchingSignalWithHttpInfoAsync}. * - * @param criticalAssetId The ID of the critical asset. (required) - * @return CompletableFuture<SecurityMonitoringCriticalAssetResponse> + * @param signalId The ID of the signal. (required) + * @return CompletableFuture<SecurityMonitoringSignalSuggestedActionsResponse> */ - public CompletableFuture - getSecurityMonitoringCriticalAssetAsync(String criticalAssetId) { - return getSecurityMonitoringCriticalAssetWithHttpInfoAsync(criticalAssetId) + public CompletableFuture + getInvestigationLogQueriesMatchingSignalAsync(String signalId) { + return getInvestigationLogQueriesMatchingSignalWithHttpInfoAsync(signalId) .thenApply( response -> { return response.getData(); @@ -10640,10 +10490,10 @@ public SecurityMonitoringCriticalAssetResponse getSecurityMonitoringCriticalAsse } /** - * Get the details of a specific critical asset. + * Get the list of investigation log queries available for a given security signal. * - * @param criticalAssetId The ID of the critical asset. (required) - * @return ApiResponse<SecurityMonitoringCriticalAssetResponse> + * @param signalId The ID of the signal. (required) + * @return ApiResponse<SecurityMonitoringSignalSuggestedActionsResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -10655,29 +10505,27 @@ public SecurityMonitoringCriticalAssetResponse getSecurityMonitoringCriticalAsse * *
429 Too many requests -
*/ - public ApiResponse - getSecurityMonitoringCriticalAssetWithHttpInfo(String criticalAssetId) throws ApiException { + public ApiResponse + getInvestigationLogQueriesMatchingSignalWithHttpInfo(String signalId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'criticalAssetId' is set - if (criticalAssetId == null) { + // verify the required parameter 'signalId' is set + if (signalId == null) { throw new ApiException( 400, - "Missing the required parameter 'criticalAssetId' when calling" - + " getSecurityMonitoringCriticalAsset"); + "Missing the required parameter 'signalId' when calling" + + " getInvestigationLogQueriesMatchingSignal"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}" - .replaceAll( - "\\{" + "critical_asset_id" + "\\}", - apiClient.escapeString(criticalAssetId.toString())); + "/api/v2/security_monitoring/signals/{signal_id}/investigation_queries" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringCriticalAsset", + "v2.SecurityMonitoringApi.getInvestigationLogQueriesMatchingSignal", localVarPath, new ArrayList(), localVarHeaderParams, @@ -10692,38 +10540,37 @@ public SecurityMonitoringCriticalAssetResponse getSecurityMonitoringCriticalAsse localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a critical asset. + * Get investigation queries for a signal. * - *

See {@link #getSecurityMonitoringCriticalAssetWithHttpInfo}. + *

See {@link #getInvestigationLogQueriesMatchingSignalWithHttpInfo}. * - * @param criticalAssetId The ID of the critical asset. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringCriticalAssetResponse>> + * @param signalId The ID of the signal. (required) + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringSignalSuggestedActionsResponse>> */ - public CompletableFuture> - getSecurityMonitoringCriticalAssetWithHttpInfoAsync(String criticalAssetId) { + public CompletableFuture> + getInvestigationLogQueriesMatchingSignalWithHttpInfoAsync(String signalId) { Object localVarPostBody = null; - // verify the required parameter 'criticalAssetId' is set - if (criticalAssetId == null) { - CompletableFuture> result = + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'criticalAssetId' when calling" - + " getSecurityMonitoringCriticalAsset")); + "Missing the required parameter 'signalId' when calling" + + " getInvestigationLogQueriesMatchingSignal")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}" - .replaceAll( - "\\{" + "critical_asset_id" + "\\}", - apiClient.escapeString(criticalAssetId.toString())); + "/api/v2/security_monitoring/signals/{signal_id}/investigation_queries" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); @@ -10731,7 +10578,7 @@ public SecurityMonitoringCriticalAssetResponse getSecurityMonitoringCriticalAsse try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringCriticalAsset", + "v2.SecurityMonitoringApi.getInvestigationLogQueriesMatchingSignal", localVarPath, new ArrayList(), localVarHeaderParams, @@ -10739,7 +10586,7 @@ public SecurityMonitoringCriticalAssetResponse getSecurityMonitoringCriticalAsse new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -10752,34 +10599,76 @@ public SecurityMonitoringCriticalAssetResponse getSecurityMonitoringCriticalAsse localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getResourceEvaluationFilters. */ + public static class GetResourceEvaluationFiltersOptionalParameters { + private String cloudProvider; + private String accountId; + private Boolean skipCache; + + /** + * Set cloudProvider. + * + * @param cloudProvider Filter resource filters by cloud provider (e.g. aws, gcp, azure). + * (optional) + * @return GetResourceEvaluationFiltersOptionalParameters + */ + public GetResourceEvaluationFiltersOptionalParameters cloudProvider(String cloudProvider) { + this.cloudProvider = cloudProvider; + return this; + } + + /** + * Set accountId. + * + * @param accountId Filter resource filters by cloud provider account ID. This parameter is only + * valid when provider is specified. (optional) + * @return GetResourceEvaluationFiltersOptionalParameters + */ + public GetResourceEvaluationFiltersOptionalParameters accountId(String accountId) { + this.accountId = accountId; + return this; + } + + /** + * Set skipCache. + * + * @param skipCache Skip cache for resource filters. (optional) + * @return GetResourceEvaluationFiltersOptionalParameters + */ + public GetResourceEvaluationFiltersOptionalParameters skipCache(Boolean skipCache) { + this.skipCache = skipCache; + return this; + } } /** - * Get a dataset. + * List resource filters. * - *

See {@link #getSecurityMonitoringDatasetWithHttpInfo}. + *

See {@link #getResourceEvaluationFiltersWithHttpInfo}. * - * @param datasetId The UUID of the dataset. (required) - * @return SecurityMonitoringDatasetResponse + * @return GetResourceEvaluationFiltersResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringDatasetResponse getSecurityMonitoringDataset(String datasetId) - throws ApiException { - return getSecurityMonitoringDatasetWithHttpInfo(datasetId).getData(); + public GetResourceEvaluationFiltersResponse getResourceEvaluationFilters() throws ApiException { + return getResourceEvaluationFiltersWithHttpInfo( + new GetResourceEvaluationFiltersOptionalParameters()) + .getData(); } /** - * Get a dataset. + * List resource filters. * - *

See {@link #getSecurityMonitoringDatasetWithHttpInfoAsync}. + *

See {@link #getResourceEvaluationFiltersWithHttpInfoAsync}. * - * @param datasetId The UUID of the dataset. (required) - * @return CompletableFuture<SecurityMonitoringDatasetResponse> + * @return CompletableFuture<GetResourceEvaluationFiltersResponse> */ - public CompletableFuture getSecurityMonitoringDatasetAsync( - String datasetId) { - return getSecurityMonitoringDatasetWithHttpInfoAsync(datasetId) + public CompletableFuture + getResourceEvaluationFiltersAsync() { + return getResourceEvaluationFiltersWithHttpInfoAsync( + new GetResourceEvaluationFiltersOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -10787,10 +10676,41 @@ public CompletableFuture getSecurityMonitorin } /** - * Get the current version of a Cloud SIEM dataset by ID. + * List resource filters. * - * @param datasetId The UUID of the dataset. (required) - * @return ApiResponse<SecurityMonitoringDatasetResponse> + *

See {@link #getResourceEvaluationFiltersWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return GetResourceEvaluationFiltersResponse + * @throws ApiException if fails to make API call + */ + public GetResourceEvaluationFiltersResponse getResourceEvaluationFilters( + GetResourceEvaluationFiltersOptionalParameters parameters) throws ApiException { + return getResourceEvaluationFiltersWithHttpInfo(parameters).getData(); + } + + /** + * List resource filters. + * + *

See {@link #getResourceEvaluationFiltersWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<GetResourceEvaluationFiltersResponse> + */ + public CompletableFuture getResourceEvaluationFiltersAsync( + GetResourceEvaluationFiltersOptionalParameters parameters) { + return getResourceEvaluationFiltersWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List resource filters. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<GetResourceEvaluationFiltersResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -10798,40 +10718,31 @@ public CompletableFuture getSecurityMonitorin * * * - * - * + * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
403 Not Authorized -
429 Too many requests -
*/ - public ApiResponse getSecurityMonitoringDatasetWithHttpInfo( - String datasetId) throws ApiException { - // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringDataset"; - 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 getResourceEvaluationFiltersWithHttpInfo( + GetResourceEvaluationFiltersOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; - - // verify the required parameter 'datasetId' is set - if (datasetId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'datasetId' when calling getSecurityMonitoringDataset"); - } + String cloudProvider = parameters.cloudProvider; + String accountId = parameters.accountId; + Boolean skipCache = parameters.skipCache; // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/datasets/{dataset_id}" - .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); + String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud_provider", cloudProvider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip_cache", skipCache)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringDataset", + "v2.SecurityMonitoringApi.getResourceEvaluationFilters", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -10844,63 +10755,47 @@ public ApiResponse getSecurityMonitoringDatas localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a dataset. + * List resource filters. * - *

See {@link #getSecurityMonitoringDatasetWithHttpInfo}. + *

See {@link #getResourceEvaluationFiltersWithHttpInfo}. * - * @param datasetId The UUID of the dataset. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringDatasetResponse>> + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<GetResourceEvaluationFiltersResponse>> */ - public CompletableFuture> - getSecurityMonitoringDatasetWithHttpInfoAsync(String datasetId) { - // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringDataset"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> + getResourceEvaluationFiltersWithHttpInfoAsync( + GetResourceEvaluationFiltersOptionalParameters parameters) { Object localVarPostBody = null; - - // verify the required parameter 'datasetId' is set - if (datasetId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'datasetId' when calling" - + " getSecurityMonitoringDataset")); - return result; - } + String cloudProvider = parameters.cloudProvider; + String accountId = parameters.accountId; + Boolean skipCache = parameters.skipCache; // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/datasets/{dataset_id}" - .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); + String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloud_provider", cloudProvider)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "account_id", accountId)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "skip_cache", skipCache)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringDataset", + "v2.SecurityMonitoringApi.getResourceEvaluationFilters", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -10913,36 +10808,64 @@ public ApiResponse getSecurityMonitoringDatas localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getRuleVersionHistory. */ + public static class GetRuleVersionHistoryOptionalParameters { + private Long pageSize; + private Long pageNumber; + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return GetRuleVersionHistoryOptionalParameters + */ + public GetRuleVersionHistoryOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return GetRuleVersionHistoryOptionalParameters + */ + public GetRuleVersionHistoryOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } } /** - * Get a dataset at a specific version. + * Get a rule's version history. * - *

See {@link #getSecurityMonitoringDatasetByVersionWithHttpInfo}. + *

See {@link #getRuleVersionHistoryWithHttpInfo}. * - * @param datasetId The UUID of the dataset. (required) - * @param version The version number of the dataset to retrieve. (required) - * @return SecurityMonitoringDatasetResponse + * @param ruleId The ID of the rule. (required) + * @return GetRuleVersionHistoryResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringDatasetResponse getSecurityMonitoringDatasetByVersion( - String datasetId, Long version) throws ApiException { - return getSecurityMonitoringDatasetByVersionWithHttpInfo(datasetId, version).getData(); + public GetRuleVersionHistoryResponse getRuleVersionHistory(String ruleId) throws ApiException { + return getRuleVersionHistoryWithHttpInfo(ruleId, new GetRuleVersionHistoryOptionalParameters()) + .getData(); } /** - * Get a dataset at a specific version. + * Get a rule's version history. * - *

See {@link #getSecurityMonitoringDatasetByVersionWithHttpInfoAsync}. + *

See {@link #getRuleVersionHistoryWithHttpInfoAsync}. * - * @param datasetId The UUID of the dataset. (required) - * @param version The version number of the dataset to retrieve. (required) - * @return CompletableFuture<SecurityMonitoringDatasetResponse> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<GetRuleVersionHistoryResponse> */ - public CompletableFuture - getSecurityMonitoringDatasetByVersionAsync(String datasetId, Long version) { - return getSecurityMonitoringDatasetByVersionWithHttpInfoAsync(datasetId, version) + public CompletableFuture getRuleVersionHistoryAsync( + String ruleId) { + return getRuleVersionHistoryWithHttpInfoAsync( + ruleId, new GetRuleVersionHistoryOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -10950,11 +10873,44 @@ public SecurityMonitoringDatasetResponse getSecurityMonitoringDatasetByVersion( } /** - * Retrieve a specific historical version of a Cloud SIEM dataset. + * Get a rule's version history. * - * @param datasetId The UUID of the dataset. (required) - * @param version The version number of the dataset to retrieve. (required) - * @return ApiResponse<SecurityMonitoringDatasetResponse> + *

See {@link #getRuleVersionHistoryWithHttpInfo}. + * + * @param ruleId The ID of the rule. (required) + * @param parameters Optional parameters for the request. + * @return GetRuleVersionHistoryResponse + * @throws ApiException if fails to make API call + */ + public GetRuleVersionHistoryResponse getRuleVersionHistory( + String ruleId, GetRuleVersionHistoryOptionalParameters parameters) throws ApiException { + return getRuleVersionHistoryWithHttpInfo(ruleId, parameters).getData(); + } + + /** + * Get a rule's version history. + * + *

See {@link #getRuleVersionHistoryWithHttpInfoAsync}. + * + * @param ruleId The ID of the rule. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<GetRuleVersionHistoryResponse> + */ + public CompletableFuture getRuleVersionHistoryAsync( + String ruleId, GetRuleVersionHistoryOptionalParameters parameters) { + return getRuleVersionHistoryWithHttpInfoAsync(ruleId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a rule's version history. + * + * @param ruleId The ID of the rule. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<GetRuleVersionHistoryResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -10962,16 +10918,15 @@ public SecurityMonitoringDatasetResponse getSecurityMonitoringDatasetByVersion( * * * - * + * * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - getSecurityMonitoringDatasetByVersionWithHttpInfo(String datasetId, Long version) - throws ApiException { + public ApiResponse getRuleVersionHistoryWithHttpInfo( + String ruleId, GetRuleVersionHistoryOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringDatasetByVersion"; + String operationId = "getRuleVersionHistory"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -10979,38 +10934,33 @@ public SecurityMonitoringDatasetResponse getSecurityMonitoringDatasetByVersion( } Object localVarPostBody = null; - // verify the required parameter 'datasetId' is set - if (datasetId == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( - 400, - "Missing the required parameter 'datasetId' when calling" - + " getSecurityMonitoringDatasetByVersion"); - } - - // verify the required parameter 'version' is set - if (version == null) { - throw new ApiException( - 400, - "Missing the required parameter 'version' when calling" - + " getSecurityMonitoringDatasetByVersion"); + 400, "Missing the required parameter 'ruleId' when calling getRuleVersionHistory"); } + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/datasets/{dataset_id}/version/{version}" - .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + "/api/v2/security_monitoring/rules/{rule_id}/version_history" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringDatasetByVersion", + "v2.SecurityMonitoringApi.getRuleVersionHistory", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -11019,26 +10969,27 @@ public SecurityMonitoringDatasetResponse getSecurityMonitoringDatasetByVersion( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a dataset at a specific version. + * Get a rule's version history. * - *

See {@link #getSecurityMonitoringDatasetByVersionWithHttpInfo}. + *

See {@link #getRuleVersionHistoryWithHttpInfo}. * - * @param datasetId The UUID of the dataset. (required) - * @param version The version number of the dataset to retrieve. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringDatasetResponse>> + * @param ruleId The ID of the rule. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<GetRuleVersionHistoryResponse>> */ - public CompletableFuture> - getSecurityMonitoringDatasetByVersionWithHttpInfoAsync(String datasetId, Long version) { + public CompletableFuture> + getRuleVersionHistoryWithHttpInfoAsync( + String ruleId, GetRuleVersionHistoryOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringDatasetByVersion"; + String operationId = "getRuleVersionHistory"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); @@ -11046,50 +10997,41 @@ public SecurityMonitoringDatasetResponse getSecurityMonitoringDatasetByVersion( } Object localVarPostBody = null; - // verify the required parameter 'datasetId' is set - if (datasetId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'datasetId' when calling" - + " getSecurityMonitoringDatasetByVersion")); - return result; - } - - // verify the required parameter 'version' is set - if (version == null) { - CompletableFuture> result = + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'version' when calling" - + " getSecurityMonitoringDatasetByVersion")); + 400, "Missing the required parameter 'ruleId' when calling getRuleVersionHistory")); return result; } + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/datasets/{dataset_id}/version/{version}" - .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + "/api/v2/security_monitoring/rules/{rule_id}/version_history" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringDatasetByVersion", + "v2.SecurityMonitoringApi.getRuleVersionHistory", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -11102,67 +11044,65 @@ public SecurityMonitoringDatasetResponse getSecurityMonitoringDatasetByVersion( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to getSecurityMonitoringDatasetVersionHistory. */ - public static class GetSecurityMonitoringDatasetVersionHistoryOptionalParameters { - private Long pageSize; - private Long pageNumber; + /** Manage optional parameters to getSBOM. */ + public static class GetSBOMOptionalParameters { + private String filterRepoDigest; + private SBOMFormat extFormat; /** - * Set pageSize. + * Set filterRepoDigest. * - * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default - * to 10) - * @return GetSecurityMonitoringDatasetVersionHistoryOptionalParameters + * @param filterRepoDigest The container image repo_digest for the SBOM request. + * When the requested asset type is 'Image', this filter is mandatory. (optional) + * @return GetSBOMOptionalParameters */ - public GetSecurityMonitoringDatasetVersionHistoryOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; + public GetSBOMOptionalParameters filterRepoDigest(String filterRepoDigest) { + this.filterRepoDigest = filterRepoDigest; return this; } /** - * Set pageNumber. + * Set extFormat. * - * @param pageNumber Specific page number to return. (optional, default to 0) - * @return GetSecurityMonitoringDatasetVersionHistoryOptionalParameters + * @param extFormat The standard of the SBOM. (optional) + * @return GetSBOMOptionalParameters */ - public GetSecurityMonitoringDatasetVersionHistoryOptionalParameters pageNumber( - Long pageNumber) { - this.pageNumber = pageNumber; + public GetSBOMOptionalParameters extFormat(SBOMFormat extFormat) { + this.extFormat = extFormat; return this; } } /** - * Get the version history of a dataset. + * Get SBOM. * - *

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfo}. + *

See {@link #getSBOMWithHttpInfo}. * - * @param datasetId The UUID of the dataset. (required) - * @return SecurityMonitoringDatasetVersionHistoryResponse + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) + * @return GetSBOMResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringDatasetVersionHistoryResponse getSecurityMonitoringDatasetVersionHistory( - String datasetId) throws ApiException { - return getSecurityMonitoringDatasetVersionHistoryWithHttpInfo( - datasetId, new GetSecurityMonitoringDatasetVersionHistoryOptionalParameters()) + public GetSBOMResponse getSBOM(AssetType assetType, String filterAssetName) throws ApiException { + return getSBOMWithHttpInfo(assetType, filterAssetName, new GetSBOMOptionalParameters()) .getData(); } /** - * Get the version history of a dataset. + * Get SBOM. * - *

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync}. + *

See {@link #getSBOMWithHttpInfoAsync}. * - * @param datasetId The UUID of the dataset. (required) - * @return CompletableFuture<SecurityMonitoringDatasetVersionHistoryResponse> + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) + * @return CompletableFuture<GetSBOMResponse> */ - public CompletableFuture - getSecurityMonitoringDatasetVersionHistoryAsync(String datasetId) { - return getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync( - datasetId, new GetSecurityMonitoringDatasetVersionHistoryOptionalParameters()) + public CompletableFuture getSBOMAsync( + AssetType assetType, String filterAssetName) { + return getSBOMWithHttpInfoAsync(assetType, filterAssetName, new GetSBOMOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -11170,35 +11110,35 @@ datasetId, new GetSecurityMonitoringDatasetVersionHistoryOptionalParameters()) } /** - * Get the version history of a dataset. + * Get SBOM. * - *

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfo}. + *

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

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync}. + *

See {@link #getSBOMWithHttpInfoAsync}. * - * @param datasetId The UUID of the dataset. (required) + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringDatasetVersionHistoryResponse> + * @return CompletableFuture<GetSBOMResponse> */ - public CompletableFuture - getSecurityMonitoringDatasetVersionHistoryAsync( - String datasetId, - GetSecurityMonitoringDatasetVersionHistoryOptionalParameters parameters) { - return getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync(datasetId, parameters) + public CompletableFuture getSBOMAsync( + AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) { + return getSBOMWithHttpInfoAsync(assetType, filterAssetName, parameters) .thenApply( response -> { return response.getData(); @@ -11206,66 +11146,65 @@ public SecurityMonitoringDatasetVersionHistoryResponse getSecurityMonitoringData } /** - * Retrieve the version history of a Cloud SIEM dataset, including the changes made at each - * version. + * Get a single SBOM related to an asset by its type and name. * - * @param datasetId The UUID of the dataset. (required) + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringDatasetVersionHistoryResponse> + * @return ApiResponse<GetSBOMResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * - * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: asset not found -
429 Too many requests -
*/ - public ApiResponse - getSecurityMonitoringDatasetVersionHistoryWithHttpInfo( - String datasetId, GetSecurityMonitoringDatasetVersionHistoryOptionalParameters parameters) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringDatasetVersionHistory"; - 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 getSBOMWithHttpInfo( + AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) + throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'datasetId' is set - if (datasetId == null) { + // verify the required parameter 'assetType' is set + if (assetType == null) { throw new ApiException( - 400, - "Missing the required parameter 'datasetId' when calling" - + " getSecurityMonitoringDatasetVersionHistory"); + 400, "Missing the required parameter 'assetType' when calling getSBOM"); } - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; + + // verify the required parameter 'filterAssetName' is set + if (filterAssetName == null) { + throw new ApiException( + 400, "Missing the required parameter 'filterAssetName' when calling getSBOM"); + } + String filterRepoDigest = parameters.filterRepoDigest; + SBOMFormat extFormat = parameters.extFormat; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/datasets/{dataset_id}/version_history" - .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); + "/api/v2/security/sboms/{asset_type}" + .replaceAll("\\{" + "asset_type" + "\\}", apiClient.escapeString(assetType.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "ext:format", extFormat)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringDatasetVersionHistory", + "v2.SecurityMonitoringApi.getSBOM", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -11274,74 +11213,68 @@ public SecurityMonitoringDatasetVersionHistoryResponse getSecurityMonitoringData localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get the version history of a dataset. + * Get SBOM. * - *

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfo}. + *

See {@link #getSBOMWithHttpInfo}. * - * @param datasetId The UUID of the dataset. (required) + * @param assetType The type of the asset for the SBOM request. (required) + * @param filterAssetName The name of the asset for the SBOM request. (required) * @param parameters Optional parameters for the request. - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringDatasetVersionHistoryResponse>> + * @return CompletableFuture<ApiResponse<GetSBOMResponse>> */ - public CompletableFuture> - getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync( - String datasetId, - GetSecurityMonitoringDatasetVersionHistoryOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringDatasetVersionHistory"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); + public CompletableFuture> getSBOMWithHttpInfoAsync( + AssetType assetType, String filterAssetName, GetSBOMOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'assetType' is set + if (assetType == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException(400, "Missing the required parameter 'assetType' when calling getSBOM")); return result; } - Object localVarPostBody = null; - // verify the required parameter 'datasetId' is set - if (datasetId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'filterAssetName' is set + if (filterAssetName == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'datasetId' when calling" - + " getSecurityMonitoringDatasetVersionHistory")); + 400, "Missing the required parameter 'filterAssetName' when calling getSBOM")); return result; } - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; + String filterRepoDigest = parameters.filterRepoDigest; + SBOMFormat extFormat = parameters.extFormat; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/datasets/{dataset_id}/version_history" - .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); + "/api/v2/security/sboms/{asset_type}" + .replaceAll("\\{" + "asset_type" + "\\}", apiClient.escapeString(assetType.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[repo_digest]", filterRepoDigest)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "ext:format", extFormat)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringDatasetVersionHistory", + "v2.SecurityMonitoringApi.getSBOM", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -11353,34 +11286,30 @@ public SecurityMonitoringDatasetVersionHistoryResponse getSecurityMonitoringData localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a hist signal's details. + * Returns a list of Secrets rules. * - *

See {@link #getSecurityMonitoringHistsignalWithHttpInfo}. + *

See {@link #getSecretsRulesWithHttpInfo}. * - * @param histsignalId The ID of the historical signal. (required) - * @return SecurityMonitoringSignalResponse + * @return SecretRuleArray * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalResponse getSecurityMonitoringHistsignal(String histsignalId) - throws ApiException { - return getSecurityMonitoringHistsignalWithHttpInfo(histsignalId).getData(); + public SecretRuleArray getSecretsRules() throws ApiException { + return getSecretsRulesWithHttpInfo().getData(); } /** - * Get a hist signal's details. + * Returns a list of Secrets rules. * - *

See {@link #getSecurityMonitoringHistsignalWithHttpInfoAsync}. + *

See {@link #getSecretsRulesWithHttpInfoAsync}. * - * @param histsignalId The ID of the historical signal. (required) - * @return CompletableFuture<SecurityMonitoringSignalResponse> + * @return CompletableFuture<SecretRuleArray> */ - public CompletableFuture getSecurityMonitoringHistsignalAsync( - String histsignalId) { - return getSecurityMonitoringHistsignalWithHttpInfoAsync(histsignalId) + public CompletableFuture getSecretsRulesAsync() { + return getSecretsRulesWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -11388,51 +11317,35 @@ public CompletableFuture getSecurityMonitoring } /** - * Get a hist signal's details. + * Returns a list of Secrets rules with ID, Pattern, Description, Priority, and SDS ID. * - * @param histsignalId The ID of the historical signal. (required) - * @return ApiResponse<SecurityMonitoringSignalResponse> + * @return ApiResponse<SecretRuleArray> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * - * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSecurityMonitoringHistsignalWithHttpInfo( - String histsignalId) throws ApiException { + public ApiResponse getSecretsRulesWithHttpInfo() throws ApiException { // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringHistsignal"; + String operationId = "getSecretsRules"; 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 'histsignalId' is set - if (histsignalId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'histsignalId' when calling" - + " getSecurityMonitoringHistsignal"); - } // create path and map variables - String localVarPath = - "/api/v2/siem-historical-detections/histsignals/{histsignal_id}" - .replaceAll( - "\\{" + "histsignal_id" + "\\}", apiClient.escapeString(histsignalId.toString())); + String localVarPath = "/api/v2/static-analysis/secrets/rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringHistsignal", + "v2.SecurityMonitoringApi.getSecretsRules", localVarPath, new ArrayList(), localVarHeaderParams, @@ -11447,48 +11360,30 @@ public ApiResponse getSecurityMonitoringHistsi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a hist signal's details. + * Returns a list of Secrets rules. * - *

See {@link #getSecurityMonitoringHistsignalWithHttpInfo}. + *

See {@link #getSecretsRulesWithHttpInfo}. * - * @param histsignalId The ID of the historical signal. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalResponse>> + * @return CompletableFuture<ApiResponse<SecretRuleArray>> */ - public CompletableFuture> - getSecurityMonitoringHistsignalWithHttpInfoAsync(String histsignalId) { + public CompletableFuture> getSecretsRulesWithHttpInfoAsync() { // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringHistsignal"; + String operationId = "getSecretsRules"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - - // verify the required parameter 'histsignalId' is set - if (histsignalId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'histsignalId' when calling" - + " getSecurityMonitoringHistsignal")); - return result; - } // create path and map variables - String localVarPath = - "/api/v2/siem-historical-detections/histsignals/{histsignal_id}" - .replaceAll( - "\\{" + "histsignal_id" + "\\}", apiClient.escapeString(histsignalId.toString())); + String localVarPath = "/api/v2/static-analysis/secrets/rules"; Map localVarHeaderParams = new HashMap(); @@ -11496,7 +11391,7 @@ public ApiResponse getSecurityMonitoringHistsi try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringHistsignal", + "v2.SecurityMonitoringApi.getSecretsRules", localVarPath, new ArrayList(), localVarHeaderParams, @@ -11504,8 +11399,7 @@ public ApiResponse getSecurityMonitoringHistsi new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -11517,154 +11411,32 @@ public ApiResponse getSecurityMonitoringHistsi localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to getSecurityMonitoringHistsignalsByJobId. */ - public static class GetSecurityMonitoringHistsignalsByJobIdOptionalParameters { - private String filterQuery; - private OffsetDateTime filterFrom; - private OffsetDateTime filterTo; - private SecurityMonitoringSignalsSort sort; - private String pageCursor; - private Integer pageLimit; - - /** - * Set filterQuery. - * - * @param filterQuery The search query for security signals. (optional) - * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters - */ - public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters filterQuery( - String filterQuery) { - this.filterQuery = filterQuery; - return this; - } - - /** - * Set filterFrom. - * - * @param filterFrom The minimum timestamp for requested security signals. (optional) - * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters - */ - public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters filterFrom( - OffsetDateTime filterFrom) { - this.filterFrom = filterFrom; - return this; - } - - /** - * Set filterTo. - * - * @param filterTo The maximum timestamp for requested security signals. (optional) - * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters - */ - public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters filterTo( - OffsetDateTime filterTo) { - this.filterTo = filterTo; - return this; - } - - /** - * Set sort. - * - * @param sort The order of the security signals in results. (optional) - * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters - */ - public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters sort( - SecurityMonitoringSignalsSort sort) { - this.sort = sort; - return this; - } - - /** - * Set pageCursor. - * - * @param pageCursor A list of results using the cursor provided in the previous query. - * (optional) - * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters - */ - public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters pageCursor(String pageCursor) { - this.pageCursor = pageCursor; - return this; - } - - /** - * Set pageLimit. - * - * @param pageLimit The maximum number of security signals in the response. (optional, default - * to 10) - * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters - */ - public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters pageLimit(Integer pageLimit) { - this.pageLimit = pageLimit; - return this; - } + new GenericType() {}); } /** - * Get a job's hist signals. + * Get a security filter. * - *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfo}. + *

See {@link #getSecurityFilterWithHttpInfo}. * - * @param jobId The ID of the job. (required) - * @return SecurityMonitoringSignalsListResponse + * @param securityFilterId The ID of the security filter. (required) + * @return SecurityFilterResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalsListResponse getSecurityMonitoringHistsignalsByJobId(String jobId) - throws ApiException { - return getSecurityMonitoringHistsignalsByJobIdWithHttpInfo( - jobId, new GetSecurityMonitoringHistsignalsByJobIdOptionalParameters()) - .getData(); + public SecurityFilterResponse getSecurityFilter(String securityFilterId) throws ApiException { + return getSecurityFilterWithHttpInfo(securityFilterId).getData(); } /** - * Get a job's hist signals. + * Get a security filter. * - *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync}. + *

See {@link #getSecurityFilterWithHttpInfoAsync}. * - * @param jobId The ID of the job. (required) - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> - */ - public CompletableFuture - getSecurityMonitoringHistsignalsByJobIdAsync(String jobId) { - return getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync( - jobId, new GetSecurityMonitoringHistsignalsByJobIdOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Get a job's hist signals. - * - *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfo}. - * - * @param jobId The ID of the job. (required) - * @param parameters Optional parameters for the request. - * @return SecurityMonitoringSignalsListResponse - * @throws ApiException if fails to make API call - */ - public SecurityMonitoringSignalsListResponse getSecurityMonitoringHistsignalsByJobId( - String jobId, GetSecurityMonitoringHistsignalsByJobIdOptionalParameters parameters) - throws ApiException { - return getSecurityMonitoringHistsignalsByJobIdWithHttpInfo(jobId, parameters).getData(); - } - - /** - * Get a job's hist signals. - * - *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync}. - * - * @param jobId The ID of the job. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + * @param securityFilterId The ID of the security filter. (required) + * @return CompletableFuture<SecurityFilterResponse> */ - public CompletableFuture - getSecurityMonitoringHistsignalsByJobIdAsync( - String jobId, GetSecurityMonitoringHistsignalsByJobIdOptionalParameters parameters) { - return getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync(jobId, parameters) + public CompletableFuture getSecurityFilterAsync(String securityFilterId) { + return getSecurityFilterWithHttpInfoAsync(securityFilterId) .thenApply( response -> { return response.getData(); @@ -11672,69 +11444,48 @@ public SecurityMonitoringSignalsListResponse getSecurityMonitoringHistsignalsByJ } /** - * Get a job's hist signals. + * Get the details of a specific security filter. * - * @param jobId The ID of the job. (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringSignalsListResponse> + *

See the security + * filter guide for more examples. + * + * @param securityFilterId The ID of the security filter. (required) + * @return ApiResponse<SecurityFilterResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - getSecurityMonitoringHistsignalsByJobIdWithHttpInfo( - String jobId, GetSecurityMonitoringHistsignalsByJobIdOptionalParameters parameters) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringHistsignalsByJobId"; - 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 getSecurityFilterWithHttpInfo(String securityFilterId) + throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'jobId' is set - if (jobId == null) { + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { throw new ApiException( - 400, - "Missing the required parameter 'jobId' when calling" - + " getSecurityMonitoringHistsignalsByJobId"); + 400, "Missing the required parameter 'securityFilterId' when calling getSecurityFilter"); } - String filterQuery = parameters.filterQuery; - OffsetDateTime filterFrom = parameters.filterFrom; - OffsetDateTime filterTo = parameters.filterTo; - SecurityMonitoringSignalsSort sort = parameters.sort; - String pageCursor = parameters.pageCursor; - Integer pageLimit = parameters.pageLimit; // create path and map variables String localVarPath = - "/api/v2/siem-historical-detections/jobs/{job_id}/histsignals" - .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" + .replaceAll( + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringHistsignalsByJobId", + "v2.SecurityMonitoringApi.getSecurityFilter", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -11747,80 +11498,52 @@ public SecurityMonitoringSignalsListResponse getSecurityMonitoringHistsignalsByJ localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a job's hist signals. + * Get a security filter. * - *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfo}. + *

See {@link #getSecurityFilterWithHttpInfo}. * - * @param jobId The ID of the job. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> + * @param securityFilterId The ID of the security filter. (required) + * @return CompletableFuture<ApiResponse<SecurityFilterResponse>> */ - public CompletableFuture> - getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync( - String jobId, GetSecurityMonitoringHistsignalsByJobIdOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringHistsignalsByJobId"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> getSecurityFilterWithHttpInfoAsync( + String securityFilterId) { Object localVarPostBody = null; - // verify the required parameter 'jobId' is set - if (jobId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'jobId' when calling" - + " getSecurityMonitoringHistsignalsByJobId")); + "Missing the required parameter 'securityFilterId' when calling getSecurityFilter")); return result; } - String filterQuery = parameters.filterQuery; - OffsetDateTime filterFrom = parameters.filterFrom; - OffsetDateTime filterTo = parameters.filterTo; - SecurityMonitoringSignalsSort sort = parameters.sort; - String pageCursor = parameters.pageCursor; - Integer pageLimit = parameters.pageLimit; // create path and map variables String localVarPath = - "/api/v2/siem-historical-detections/jobs/{job_id}/histsignals" - .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" + .replaceAll( + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringHistsignalsByJobId", + "v2.SecurityMonitoringApi.getSecurityFilter", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -11832,34 +11555,34 @@ public SecurityMonitoringSignalsListResponse getSecurityMonitoringHistsignalsByJ localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get an entity context sync configuration. + * Get a due date rule. * - *

See {@link #getSecurityMonitoringIntegrationConfigWithHttpInfo}. + *

See {@link #getSecurityFindingsAutomationDueDateRuleWithHttpInfo}. * - * @param integrationConfigId The ID of the entity context sync configuration. (required) - * @return SecurityMonitoringIntegrationConfigResponse + * @param ruleId The ID of the due date rule. (required) + * @return DueDateRuleResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringIntegrationConfigResponse getSecurityMonitoringIntegrationConfig( - String integrationConfigId) throws ApiException { - return getSecurityMonitoringIntegrationConfigWithHttpInfo(integrationConfigId).getData(); + public DueDateRuleResponse getSecurityFindingsAutomationDueDateRule(UUID ruleId) + throws ApiException { + return getSecurityFindingsAutomationDueDateRuleWithHttpInfo(ruleId).getData(); } /** - * Get an entity context sync configuration. + * Get a due date rule. * - *

See {@link #getSecurityMonitoringIntegrationConfigWithHttpInfoAsync}. + *

See {@link #getSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync}. * - * @param integrationConfigId The ID of the entity context sync configuration. (required) - * @return CompletableFuture<SecurityMonitoringIntegrationConfigResponse> + * @param ruleId The ID of the due date rule. (required) + * @return CompletableFuture<DueDateRuleResponse> */ - public CompletableFuture - getSecurityMonitoringIntegrationConfigAsync(String integrationConfigId) { - return getSecurityMonitoringIntegrationConfigWithHttpInfoAsync(integrationConfigId) + public CompletableFuture getSecurityFindingsAutomationDueDateRuleAsync( + UUID ruleId) { + return getSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -11867,26 +11590,25 @@ public SecurityMonitoringIntegrationConfigResponse getSecurityMonitoringIntegrat } /** - * Get the details of a specific entity context sync configuration. + * Get the details of a due date rule by ID. * - * @param integrationConfigId The ID of the entity context sync configuration. (required) - * @return ApiResponse<SecurityMonitoringIntegrationConfigResponse> + * @param ruleId The ID of the due date rule. (required) + * @return ApiResponse<DueDateRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
200 Successfully retrieved the due date rule -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - getSecurityMonitoringIntegrationConfigWithHttpInfo(String integrationConfigId) - throws ApiException { + public ApiResponse getSecurityFindingsAutomationDueDateRuleWithHttpInfo( + UUID ruleId) throws ApiException { // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringIntegrationConfig"; + String operationId = "getSecurityFindingsAutomationDueDateRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -11894,31 +11616,29 @@ public SecurityMonitoringIntegrationConfigResponse getSecurityMonitoringIntegrat } Object localVarPostBody = null; - // verify the required parameter 'integrationConfigId' is set - if (integrationConfigId == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( 400, - "Missing the required parameter 'integrationConfigId' when calling" - + " getSecurityMonitoringIntegrationConfig"); + "Missing the required parameter 'ruleId' when calling" + + " getSecurityFindingsAutomationDueDateRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" - .replaceAll( - "\\{" + "integration_config_id" + "\\}", - apiClient.escapeString(integrationConfigId.toString())); + "/api/v2/security/findings/automation/due_date_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringIntegrationConfig", + "v2.SecurityMonitoringApi.getSecurityFindingsAutomationDueDateRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -11927,49 +11647,45 @@ public SecurityMonitoringIntegrationConfigResponse getSecurityMonitoringIntegrat localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get an entity context sync configuration. + * Get a due date rule. * - *

See {@link #getSecurityMonitoringIntegrationConfigWithHttpInfo}. + *

See {@link #getSecurityFindingsAutomationDueDateRuleWithHttpInfo}. * - * @param integrationConfigId The ID of the entity context sync configuration. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringIntegrationConfigResponse>> + * @param ruleId The ID of the due date rule. (required) + * @return CompletableFuture<ApiResponse<DueDateRuleResponse>> */ - public CompletableFuture> - getSecurityMonitoringIntegrationConfigWithHttpInfoAsync(String integrationConfigId) { + public CompletableFuture> + getSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync(UUID ruleId) { // Check if unstable operation is enabled - String operationId = "getSecurityMonitoringIntegrationConfig"; + String operationId = "getSecurityFindingsAutomationDueDateRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - // verify the required parameter 'integrationConfigId' is set - if (integrationConfigId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'integrationConfigId' when calling" - + " getSecurityMonitoringIntegrationConfig")); + "Missing the required parameter 'ruleId' when calling" + + " getSecurityFindingsAutomationDueDateRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" - .replaceAll( - "\\{" + "integration_config_id" + "\\}", - apiClient.escapeString(integrationConfigId.toString())); + "/api/v2/security/findings/automation/due_date_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -11977,16 +11693,15 @@ public SecurityMonitoringIntegrationConfigResponse getSecurityMonitoringIntegrat try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringIntegrationConfig", + "v2.SecurityMonitoringApi.getSecurityFindingsAutomationDueDateRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -11998,34 +11713,33 @@ public SecurityMonitoringIntegrationConfigResponse getSecurityMonitoringIntegrat localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a rule's details. + * Get a mute rule. * - *

See {@link #getSecurityMonitoringRuleWithHttpInfo}. + *

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

See {@link #getSecurityMonitoringRuleWithHttpInfoAsync}. + *

See {@link #getSecurityFindingsAutomationMuteRuleWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) - * @return CompletableFuture<SecurityMonitoringRuleResponse> + * @param ruleId The ID of the mute rule. (required) + * @return CompletableFuture<MuteRuleResponse> */ - public CompletableFuture getSecurityMonitoringRuleAsync( - String ruleId) { - return getSecurityMonitoringRuleWithHttpInfoAsync(ruleId) + public CompletableFuture getSecurityFindingsAutomationMuteRuleAsync( + UUID ruleId) { + return getSecurityFindingsAutomationMuteRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -12033,45 +11747,55 @@ public CompletableFuture getSecurityMonitoringRu } /** - * Get a rule's details. + * Get the details of a mute rule by ID. * - * @param ruleId The ID of the rule. (required) - * @return ApiResponse<SecurityMonitoringRuleResponse> + * @param ruleId The ID of the mute rule. (required) + * @return ApiResponse<MuteRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
200 Successfully retrieved the mute rule -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSecurityMonitoringRuleWithHttpInfo( - String ruleId) throws ApiException { + public ApiResponse getSecurityFindingsAutomationMuteRuleWithHttpInfo( + UUID ruleId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getSecurityFindingsAutomationMuteRule"; + 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 'ruleId' is set if (ruleId == null) { throw new ApiException( - 400, "Missing the required parameter 'ruleId' when calling getSecurityMonitoringRule"); + 400, + "Missing the required parameter 'ruleId' when calling" + + " getSecurityFindingsAutomationMuteRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}" + "/api/v2/security/findings/automation/mute_rules/{rule_id}" .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringRule", + "v2.SecurityMonitoringApi.getSecurityFindingsAutomationMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -12080,34 +11804,44 @@ public ApiResponse getSecurityMonitoringRuleWith localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a rule's details. + * Get a mute rule. * - *

See {@link #getSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #getSecurityFindingsAutomationMuteRuleWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleResponse>> + * @param ruleId The ID of the mute rule. (required) + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> */ - public CompletableFuture> - getSecurityMonitoringRuleWithHttpInfoAsync(String ruleId) { + public CompletableFuture> + getSecurityFindingsAutomationMuteRuleWithHttpInfoAsync(UUID ruleId) { + // Check if unstable operation is enabled + String operationId = "getSecurityFindingsAutomationMuteRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; // verify the required parameter 'ruleId' is set if (ruleId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'ruleId' when calling getSecurityMonitoringRule")); + "Missing the required parameter 'ruleId' when calling" + + " getSecurityFindingsAutomationMuteRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}" + "/api/v2/security/findings/automation/mute_rules/{rule_id}" .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -12116,16 +11850,15 @@ public ApiResponse getSecurityMonitoringRuleWith try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringRule", + "v2.SecurityMonitoringApi.getSecurityFindingsAutomationMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -12137,34 +11870,34 @@ public ApiResponse getSecurityMonitoringRuleWith localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a signal's details. + * Get a ticket creation rule. * - *

See {@link #getSecurityMonitoringSignalWithHttpInfo}. + *

See {@link #getSecurityFindingsAutomationTicketCreationRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @return SecurityMonitoringSignalResponse + * @param ruleId The ID of the ticket creation rule. (required) + * @return TicketCreationRuleResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalResponse getSecurityMonitoringSignal(String signalId) + public TicketCreationRuleResponse getSecurityFindingsAutomationTicketCreationRule(UUID ruleId) throws ApiException { - return getSecurityMonitoringSignalWithHttpInfo(signalId).getData(); + return getSecurityFindingsAutomationTicketCreationRuleWithHttpInfo(ruleId).getData(); } /** - * Get a signal's details. + * Get a ticket creation rule. * - *

See {@link #getSecurityMonitoringSignalWithHttpInfoAsync}. + *

See {@link #getSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync}. * - * @param signalId The ID of the signal. (required) - * @return CompletableFuture<SecurityMonitoringSignalResponse> + * @param ruleId The ID of the ticket creation rule. (required) + * @return CompletableFuture<TicketCreationRuleResponse> */ - public CompletableFuture getSecurityMonitoringSignalAsync( - String signalId) { - return getSecurityMonitoringSignalWithHttpInfoAsync(signalId) + public CompletableFuture + getSecurityFindingsAutomationTicketCreationRuleAsync(UUID ruleId) { + return getSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -12172,47 +11905,55 @@ public CompletableFuture getSecurityMonitoring } /** - * Get a signal's details. + * Get the details of a ticket creation rule by ID. * - * @param signalId The ID of the signal. (required) - * @return ApiResponse<SecurityMonitoringSignalResponse> + * @param ruleId The ID of the ticket creation rule. (required) + * @return ApiResponse<TicketCreationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
200 Successfully retrieved the ticket creation rule -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSecurityMonitoringSignalWithHttpInfo( - String signalId) throws ApiException { + public ApiResponse + getSecurityFindingsAutomationTicketCreationRuleWithHttpInfo(UUID ruleId) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getSecurityFindingsAutomationTicketCreationRule"; + 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 'signalId' is set - if (signalId == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( 400, - "Missing the required parameter 'signalId' when calling getSecurityMonitoringSignal"); + "Missing the required parameter 'ruleId' when calling" + + " getSecurityFindingsAutomationTicketCreationRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringSignal", + "v2.SecurityMonitoringApi.getSecurityFindingsAutomationTicketCreationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -12221,36 +11962,45 @@ public ApiResponse getSecurityMonitoringSignal localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a signal's details. + * Get a ticket creation rule. * - *

See {@link #getSecurityMonitoringSignalWithHttpInfo}. + *

See {@link #getSecurityFindingsAutomationTicketCreationRuleWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalResponse>> + * @param ruleId The ID of the ticket creation rule. (required) + * @return CompletableFuture<ApiResponse<TicketCreationRuleResponse>> */ - public CompletableFuture> - getSecurityMonitoringSignalWithHttpInfoAsync(String signalId) { + public CompletableFuture> + getSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync(UUID ruleId) { + // Check if unstable operation is enabled + String operationId = "getSecurityFindingsAutomationTicketCreationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'signalId' when calling" - + " getSecurityMonitoringSignal")); + "Missing the required parameter 'ruleId' when calling" + + " getSecurityFindingsAutomationTicketCreationRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -12258,16 +12008,15 @@ public ApiResponse getSecurityMonitoringSignal try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringSignal", + "v2.SecurityMonitoringApi.getSecurityFindingsAutomationTicketCreationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -12279,34 +12028,34 @@ public ApiResponse getSecurityMonitoringSignal localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a suppression rule. + * Get a critical asset. * - *

See {@link #getSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #getSecurityMonitoringCriticalAssetWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) - * @return SecurityMonitoringSuppressionResponse + * @param criticalAssetId The ID of the critical asset. (required) + * @return SecurityMonitoringCriticalAssetResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( - String suppressionId) throws ApiException { - return getSecurityMonitoringSuppressionWithHttpInfo(suppressionId).getData(); + public SecurityMonitoringCriticalAssetResponse getSecurityMonitoringCriticalAsset( + String criticalAssetId) throws ApiException { + return getSecurityMonitoringCriticalAssetWithHttpInfo(criticalAssetId).getData(); } /** - * Get a suppression rule. + * Get a critical asset. * - *

See {@link #getSecurityMonitoringSuppressionWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringCriticalAssetWithHttpInfoAsync}. * - * @param suppressionId The ID of the suppression rule (required) - * @return CompletableFuture<SecurityMonitoringSuppressionResponse> + * @param criticalAssetId The ID of the critical asset. (required) + * @return CompletableFuture<SecurityMonitoringCriticalAssetResponse> */ - public CompletableFuture - getSecurityMonitoringSuppressionAsync(String suppressionId) { - return getSecurityMonitoringSuppressionWithHttpInfoAsync(suppressionId) + public CompletableFuture + getSecurityMonitoringCriticalAssetAsync(String criticalAssetId) { + return getSecurityMonitoringCriticalAssetWithHttpInfoAsync(criticalAssetId) .thenApply( response -> { return response.getData(); @@ -12314,10 +12063,10 @@ public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( } /** - * Get the details of a specific suppression rule. + * Get the details of a specific critical asset. * - * @param suppressionId The ID of the suppression rule (required) - * @return ApiResponse<SecurityMonitoringSuppressionResponse> + * @param criticalAssetId The ID of the critical asset. (required) + * @return ApiResponse<SecurityMonitoringCriticalAssetResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -12329,28 +12078,29 @@ public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( * *
429 Too many requests -
*/ - public ApiResponse - getSecurityMonitoringSuppressionWithHttpInfo(String suppressionId) throws ApiException { + public ApiResponse + getSecurityMonitoringCriticalAssetWithHttpInfo(String criticalAssetId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { + // verify the required parameter 'criticalAssetId' is set + if (criticalAssetId == null) { throw new ApiException( 400, - "Missing the required parameter 'suppressionId' when calling" - + " getSecurityMonitoringSuppression"); + "Missing the required parameter 'criticalAssetId' when calling" + + " getSecurityMonitoringCriticalAsset"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + "/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}" .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "\\{" + "critical_asset_id" + "\\}", + apiClient.escapeString(criticalAssetId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.getSecurityMonitoringCriticalAsset", localVarPath, new ArrayList(), localVarHeaderParams, @@ -12365,37 +12115,38 @@ public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a suppression rule. + * Get a critical asset. * - *

See {@link #getSecurityMonitoringSuppressionWithHttpInfo}. + *

See {@link #getSecurityMonitoringCriticalAssetWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionResponse>> + * @param criticalAssetId The ID of the critical asset. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringCriticalAssetResponse>> */ - public CompletableFuture> - getSecurityMonitoringSuppressionWithHttpInfoAsync(String suppressionId) { + public CompletableFuture> + getSecurityMonitoringCriticalAssetWithHttpInfoAsync(String criticalAssetId) { Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { - CompletableFuture> result = + // verify the required parameter 'criticalAssetId' is set + if (criticalAssetId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'suppressionId' when calling" - + " getSecurityMonitoringSuppression")); + "Missing the required parameter 'criticalAssetId' when calling" + + " getSecurityMonitoringCriticalAsset")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + "/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}" .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "\\{" + "critical_asset_id" + "\\}", + apiClient.escapeString(criticalAssetId.toString())); Map localVarHeaderParams = new HashMap(); @@ -12403,7 +12154,7 @@ public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSecurityMonitoringSuppression", + "v2.SecurityMonitoringApi.getSecurityMonitoringCriticalAsset", localVarPath, new ArrayList(), localVarHeaderParams, @@ -12411,7 +12162,7 @@ public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -12424,49 +12175,34 @@ public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to getSignalEntities. */ - public static class GetSignalEntitiesOptionalParameters { - private Integer limit; - - /** - * Set limit. - * - * @param limit The maximum number of entities to return. (optional, default to 10) - * @return GetSignalEntitiesOptionalParameters - */ - public GetSignalEntitiesOptionalParameters limit(Integer limit) { - this.limit = limit; - return this; - } + new GenericType() {}); } /** - * Get entities related to a signal. + * Get a dataset. * - *

See {@link #getSignalEntitiesWithHttpInfo}. + *

See {@link #getSecurityMonitoringDatasetWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @return SignalEntitiesResponse + * @param datasetId The UUID of the dataset. (required) + * @return SecurityMonitoringDatasetResponse * @throws ApiException if fails to make API call */ - public SignalEntitiesResponse getSignalEntities(String signalId) throws ApiException { - return getSignalEntitiesWithHttpInfo(signalId, new GetSignalEntitiesOptionalParameters()) - .getData(); + public SecurityMonitoringDatasetResponse getSecurityMonitoringDataset(String datasetId) + throws ApiException { + return getSecurityMonitoringDatasetWithHttpInfo(datasetId).getData(); } /** - * Get entities related to a signal. + * Get a dataset. * - *

See {@link #getSignalEntitiesWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringDatasetWithHttpInfoAsync}. * - * @param signalId The ID of the signal. (required) - * @return CompletableFuture<SignalEntitiesResponse> + * @param datasetId The UUID of the dataset. (required) + * @return CompletableFuture<SecurityMonitoringDatasetResponse> */ - public CompletableFuture getSignalEntitiesAsync(String signalId) { - return getSignalEntitiesWithHttpInfoAsync(signalId, new GetSignalEntitiesOptionalParameters()) + public CompletableFuture getSecurityMonitoringDatasetAsync( + String datasetId) { + return getSecurityMonitoringDatasetWithHttpInfoAsync(datasetId) .thenApply( response -> { return response.getData(); @@ -12474,44 +12210,10 @@ public CompletableFuture getSignalEntitiesAsync(String s } /** - * Get entities related to a signal. - * - *

See {@link #getSignalEntitiesWithHttpInfo}. + * Get the current version of a Cloud SIEM dataset by ID. * - * @param signalId The ID of the signal. (required) - * @param parameters Optional parameters for the request. - * @return SignalEntitiesResponse - * @throws ApiException if fails to make API call - */ - public SignalEntitiesResponse getSignalEntities( - String signalId, GetSignalEntitiesOptionalParameters parameters) throws ApiException { - return getSignalEntitiesWithHttpInfo(signalId, parameters).getData(); - } - - /** - * Get entities related to a signal. - * - *

See {@link #getSignalEntitiesWithHttpInfoAsync}. - * - * @param signalId The ID of the signal. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<SignalEntitiesResponse> - */ - public CompletableFuture getSignalEntitiesAsync( - String signalId, GetSignalEntitiesOptionalParameters parameters) { - return getSignalEntitiesWithHttpInfoAsync(signalId, parameters) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Get the list of entities related to a security signal, captured at the signal's timestamp. - * - * @param signalId The ID of the signal. (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<SignalEntitiesResponse> + * @param datasetId The UUID of the dataset. (required) + * @return ApiResponse<SecurityMonitoringDatasetResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -12519,15 +12221,15 @@ public CompletableFuture getSignalEntitiesAsync( * * * - * + * * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSignalEntitiesWithHttpInfo( - String signalId, GetSignalEntitiesOptionalParameters parameters) throws ApiException { + public ApiResponse getSecurityMonitoringDatasetWithHttpInfo( + String datasetId) throws ApiException { // Check if unstable operation is enabled - String operationId = "getSignalEntities"; + String operationId = "getSecurityMonitoringDataset"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -12535,27 +12237,24 @@ public ApiResponse getSignalEntitiesWithHttpInfo( } Object localVarPostBody = null; - // verify the required parameter 'signalId' is set - if (signalId == null) { + // verify the required parameter 'datasetId' is set + if (datasetId == null) { throw new ApiException( - 400, "Missing the required parameter 'signalId' when calling getSignalEntities"); + 400, + "Missing the required parameter 'datasetId' when calling getSecurityMonitoringDataset"); } - Integer limit = parameters.limit; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/entities" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security_monitoring/datasets/{dataset_id}" + .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSignalEntities", + "v2.SecurityMonitoringApi.getSecurityMonitoringDataset", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -12568,64 +12267,64 @@ public ApiResponse getSignalEntitiesWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get entities related to a signal. + * Get a dataset. * - *

See {@link #getSignalEntitiesWithHttpInfo}. + *

See {@link #getSecurityMonitoringDatasetWithHttpInfo}. * - * @param signalId The ID of the signal. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SignalEntitiesResponse>> + * @param datasetId The UUID of the dataset. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringDatasetResponse>> */ - public CompletableFuture> getSignalEntitiesWithHttpInfoAsync( - String signalId, GetSignalEntitiesOptionalParameters parameters) { + public CompletableFuture> + getSecurityMonitoringDatasetWithHttpInfoAsync(String datasetId) { // Check if unstable operation is enabled - String operationId = "getSignalEntities"; + String operationId = "getSecurityMonitoringDataset"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - // verify the required parameter 'signalId' is set - if (signalId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'datasetId' is set + if (datasetId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'signalId' when calling getSignalEntities")); + 400, + "Missing the required parameter 'datasetId' when calling" + + " getSecurityMonitoringDataset")); return result; } - Integer limit = parameters.limit; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/entities" - .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + "/api/v2/security_monitoring/datasets/{dataset_id}" + .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSignalEntities", + "v2.SecurityMonitoringApi.getSecurityMonitoringDataset", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -12637,32 +12336,36 @@ public CompletableFuture> getSignalEntitiesW localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get details of a signal-based notification rule. + * Get a dataset at a specific version. * - *

See {@link #getSignalNotificationRuleWithHttpInfo}. + *

See {@link #getSecurityMonitoringDatasetByVersionWithHttpInfo}. * - * @param id ID of the notification rule. (required) - * @return NotificationRuleResponse + * @param datasetId The UUID of the dataset. (required) + * @param version The version number of the dataset to retrieve. (required) + * @return SecurityMonitoringDatasetResponse * @throws ApiException if fails to make API call */ - public NotificationRuleResponse getSignalNotificationRule(String id) throws ApiException { - return getSignalNotificationRuleWithHttpInfo(id).getData(); + public SecurityMonitoringDatasetResponse getSecurityMonitoringDatasetByVersion( + String datasetId, Long version) throws ApiException { + return getSecurityMonitoringDatasetByVersionWithHttpInfo(datasetId, version).getData(); } /** - * Get details of a signal-based notification rule. + * Get a dataset at a specific version. * - *

See {@link #getSignalNotificationRuleWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringDatasetByVersionWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) - * @return CompletableFuture<NotificationRuleResponse> + * @param datasetId The UUID of the dataset. (required) + * @param version The version number of the dataset to retrieve. (required) + * @return CompletableFuture<SecurityMonitoringDatasetResponse> */ - public CompletableFuture getSignalNotificationRuleAsync(String id) { - return getSignalNotificationRuleWithHttpInfoAsync(id) + public CompletableFuture + getSecurityMonitoringDatasetByVersionAsync(String datasetId, Long version) { + return getSecurityMonitoringDatasetByVersionWithHttpInfoAsync(datasetId, version) .thenApply( response -> { return response.getData(); @@ -12670,47 +12373,67 @@ public CompletableFuture getSignalNotificationRuleAsyn } /** - * Get the details of a notification rule for security signals. + * Retrieve a specific historical version of a Cloud SIEM dataset. * - * @param id ID of the notification rule. (required) - * @return ApiResponse<NotificationRuleResponse> + * @param datasetId The UUID of the dataset. (required) + * @param version The version number of the dataset to retrieve. (required) + * @return ApiResponse<SecurityMonitoringDatasetResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * * *
Response details
Status Code Description Response Headers
200 Notification rule details. -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSignalNotificationRuleWithHttpInfo(String id) - throws ApiException { + public ApiResponse + getSecurityMonitoringDatasetByVersionWithHttpInfo(String datasetId, Long version) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getSecurityMonitoringDatasetByVersion"; + 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 'id' is set - if (id == null) { + // verify the required parameter 'datasetId' is set + if (datasetId == null) { throw new ApiException( - 400, "Missing the required parameter 'id' when calling getSignalNotificationRule"); + 400, + "Missing the required parameter 'datasetId' when calling" + + " getSecurityMonitoringDatasetByVersion"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + 400, + "Missing the required parameter 'version' when calling" + + " getSecurityMonitoringDatasetByVersion"); } // create path and map variables String localVarPath = - "/api/v2/security/signals/notification_rules/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + "/api/v2/security_monitoring/datasets/{dataset_id}/version/{version}" + .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSignalNotificationRule", + "v2.SecurityMonitoringApi.getSecurityMonitoringDatasetByVersion", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", builder, @@ -12719,33 +12442,61 @@ public ApiResponse getSignalNotificationRuleWithHttpIn localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get details of a signal-based notification rule. + * Get a dataset at a specific version. * - *

See {@link #getSignalNotificationRuleWithHttpInfo}. + *

See {@link #getSecurityMonitoringDatasetByVersionWithHttpInfo}. * - * @param id ID of the notification rule. (required) - * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> + * @param datasetId The UUID of the dataset. (required) + * @param version The version number of the dataset to retrieve. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringDatasetResponse>> */ - public CompletableFuture> - getSignalNotificationRuleWithHttpInfoAsync(String id) { + public CompletableFuture> + getSecurityMonitoringDatasetByVersionWithHttpInfoAsync(String datasetId, Long version) { + // Check if unstable operation is enabled + String operationId = "getSecurityMonitoringDatasetByVersion"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'datasetId' is set + if (datasetId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'id' when calling getSignalNotificationRule")); + 400, + "Missing the required parameter 'datasetId' when calling" + + " getSecurityMonitoringDatasetByVersion")); + return result; + } + + // verify the required parameter 'version' is set + if (version == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'version' when calling" + + " getSecurityMonitoringDatasetByVersion")); 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/datasets/{dataset_id}/version/{version}" + .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); Map localVarHeaderParams = new HashMap(); @@ -12753,15 +12504,16 @@ public ApiResponse getSignalNotificationRuleWithHttpIn try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSignalNotificationRule", + "v2.SecurityMonitoringApi.getSecurityMonitoringDatasetByVersion", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -12773,193 +12525,67 @@ public ApiResponse getSignalNotificationRuleWithHttpIn localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** - * Get the list of signal-based notification rules. - * - *

See {@link #getSignalNotificationRulesWithHttpInfo}. - * - * @return NotificationRulesListResponse - * @throws ApiException if fails to make API call - */ - public NotificationRulesListResponse getSignalNotificationRules() throws ApiException { - return getSignalNotificationRulesWithHttpInfo().getData(); - } - - /** - * Get the list of signal-based notification rules. - * - *

See {@link #getSignalNotificationRulesWithHttpInfoAsync}. - * - * @return CompletableFuture<NotificationRulesListResponse> - */ - public CompletableFuture getSignalNotificationRulesAsync() { - return getSignalNotificationRulesWithHttpInfoAsync() - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Returns the list of notification rules for security signals. - * - * @return ApiResponse<NotificationRulesListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 The list of notification rules. -
403 Forbidden -
429 Too many requests -
- */ - public ApiResponse getSignalNotificationRulesWithHttpInfo() - throws ApiException { - Object localVarPostBody = null; - // create path and map variables - String localVarPath = "/api/v2/security/signals/notification_rules"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSignalNotificationRules", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Get the list of signal-based notification rules. - * - *

See {@link #getSignalNotificationRulesWithHttpInfo}. - * - * @return CompletableFuture<ApiResponse<NotificationRulesListResponse>> - */ - public CompletableFuture> - getSignalNotificationRulesWithHttpInfoAsync() { - Object localVarPostBody = null; - // create path and map variables - String localVarPath = "/api/v2/security/signals/notification_rules"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSignalNotificationRules", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); - } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; - } - return apiClient.invokeAPIAsync( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** Manage optional parameters to getSingleEntityContext. */ - public static class GetSingleEntityContextOptionalParameters { - private String from; - private String to; - private String asOf; - - /** - * Set from. - * - * @param from The start of the time range to query, as an RFC3339 timestamp or a relative time - * (for example, now-7d). Defaults to now-7d. Ignored when - * as_of is set. (optional, default to "now-7d") - * @return GetSingleEntityContextOptionalParameters - */ - public GetSingleEntityContextOptionalParameters from(String from) { - this.from = from; - return this; - } + /** Manage optional parameters to getSecurityMonitoringDatasetVersionHistory. */ + public static class GetSecurityMonitoringDatasetVersionHistoryOptionalParameters { + private Long pageSize; + private Long pageNumber; /** - * Set to. + * Set pageSize. * - * @param to The end of the time range to query, as an RFC3339 timestamp or a relative time (for - * example, now). Defaults to now. Ignored when as_of - * is set. (optional, default to "now") - * @return GetSingleEntityContextOptionalParameters + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return GetSecurityMonitoringDatasetVersionHistoryOptionalParameters */ - public GetSingleEntityContextOptionalParameters to(String to) { - this.to = to; + public GetSecurityMonitoringDatasetVersionHistoryOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; return this; } /** - * Set asOf. + * Set pageNumber. * - * @param asOf A point in time at which to query the entity revisions, as an RFC3339 timestamp, - * a Unix timestamp (in seconds), or a relative time (for example, now-1d). - * When set, from and to are ignored. Cannot be combined with - * custom from / to values. (optional) - * @return GetSingleEntityContextOptionalParameters + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return GetSecurityMonitoringDatasetVersionHistoryOptionalParameters */ - public GetSingleEntityContextOptionalParameters asOf(String asOf) { - this.asOf = asOf; + public GetSecurityMonitoringDatasetVersionHistoryOptionalParameters pageNumber( + Long pageNumber) { + this.pageNumber = pageNumber; return this; } } /** - * Get a single entity context. + * Get the version history of a dataset. * - *

See {@link #getSingleEntityContextWithHttpInfo}. + *

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfo}. * - * @param id The unique identifier of the entity to retrieve. (required) - * @return SingleEntityContextResponse + * @param datasetId The UUID of the dataset. (required) + * @return SecurityMonitoringDatasetVersionHistoryResponse * @throws ApiException if fails to make API call */ - public SingleEntityContextResponse getSingleEntityContext(String id) throws ApiException { - return getSingleEntityContextWithHttpInfo(id, new GetSingleEntityContextOptionalParameters()) + public SecurityMonitoringDatasetVersionHistoryResponse getSecurityMonitoringDatasetVersionHistory( + String datasetId) throws ApiException { + return getSecurityMonitoringDatasetVersionHistoryWithHttpInfo( + datasetId, new GetSecurityMonitoringDatasetVersionHistoryOptionalParameters()) .getData(); } /** - * Get a single entity context. + * Get the version history of a dataset. * - *

See {@link #getSingleEntityContextWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync}. * - * @param id The unique identifier of the entity to retrieve. (required) - * @return CompletableFuture<SingleEntityContextResponse> + * @param datasetId The UUID of the dataset. (required) + * @return CompletableFuture<SecurityMonitoringDatasetVersionHistoryResponse> */ - public CompletableFuture getSingleEntityContextAsync(String id) { - return getSingleEntityContextWithHttpInfoAsync( - id, new GetSingleEntityContextOptionalParameters()) + public CompletableFuture + getSecurityMonitoringDatasetVersionHistoryAsync(String datasetId) { + return getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync( + datasetId, new GetSecurityMonitoringDatasetVersionHistoryOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -12967,32 +12593,35 @@ id, new GetSingleEntityContextOptionalParameters()) } /** - * Get a single entity context. + * Get the version history of a dataset. * - *

See {@link #getSingleEntityContextWithHttpInfo}. + *

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfo}. * - * @param id The unique identifier of the entity to retrieve. (required) + * @param datasetId The UUID of the dataset. (required) * @param parameters Optional parameters for the request. - * @return SingleEntityContextResponse + * @return SecurityMonitoringDatasetVersionHistoryResponse * @throws ApiException if fails to make API call */ - public SingleEntityContextResponse getSingleEntityContext( - String id, GetSingleEntityContextOptionalParameters parameters) throws ApiException { - return getSingleEntityContextWithHttpInfo(id, parameters).getData(); + public SecurityMonitoringDatasetVersionHistoryResponse getSecurityMonitoringDatasetVersionHistory( + String datasetId, GetSecurityMonitoringDatasetVersionHistoryOptionalParameters parameters) + throws ApiException { + return getSecurityMonitoringDatasetVersionHistoryWithHttpInfo(datasetId, parameters).getData(); } /** - * Get a single entity context. + * Get the version history of a dataset. * - *

See {@link #getSingleEntityContextWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync}. * - * @param id The unique identifier of the entity to retrieve. (required) + * @param datasetId The UUID of the dataset. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<SingleEntityContextResponse> + * @return CompletableFuture<SecurityMonitoringDatasetVersionHistoryResponse> */ - public CompletableFuture getSingleEntityContextAsync( - String id, GetSingleEntityContextOptionalParameters parameters) { - return getSingleEntityContextWithHttpInfoAsync(id, parameters) + public CompletableFuture + getSecurityMonitoringDatasetVersionHistoryAsync( + String datasetId, + GetSecurityMonitoringDatasetVersionHistoryOptionalParameters parameters) { + return getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync(datasetId, parameters) .thenApply( response -> { return response.getData(); @@ -13000,14 +12629,12 @@ public CompletableFuture getSingleEntityContextAsyn } /** - * Get a single entity from the Cloud SIEM entity context store by its identifier, returning the - * historical revisions of the entity in the requested time range. The endpoint can either return - * revisions across an interval (from / to) or the snapshot of the - * entity at a single point in time (as_of); the two modes are mutually exclusive. + * Retrieve the version history of a Cloud SIEM dataset, including the changes made at each + * version. * - * @param id The unique identifier of the entity to retrieve. (required) + * @param datasetId The UUID of the dataset. (required) * @param parameters Optional parameters for the request. - * @return ApiResponse<SingleEntityContextResponse> + * @return ApiResponse<SecurityMonitoringDatasetVersionHistoryResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -13015,15 +12642,17 @@ public CompletableFuture getSingleEntityContextAsyn * * * - * + * * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSingleEntityContextWithHttpInfo( - String id, GetSingleEntityContextOptionalParameters parameters) throws ApiException { + public ApiResponse + getSecurityMonitoringDatasetVersionHistoryWithHttpInfo( + String datasetId, GetSecurityMonitoringDatasetVersionHistoryOptionalParameters parameters) + throws ApiException { // Check if unstable operation is enabled - String operationId = "getSingleEntityContext"; + String operationId = "getSecurityMonitoringDatasetVersionHistory"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -13031,29 +12660,29 @@ public ApiResponse getSingleEntityContextWithHttpIn } Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { + // verify the required parameter 'datasetId' is set + if (datasetId == null) { throw new ApiException( - 400, "Missing the required parameter 'id' when calling getSingleEntityContext"); + 400, + "Missing the required parameter 'datasetId' when calling" + + " getSecurityMonitoringDatasetVersionHistory"); } - String from = parameters.from; - String to = parameters.to; - String asOf = parameters.asOf; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/entity_context/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + "/api/v2/security_monitoring/datasets/{dataset_id}/version_history" + .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSingleEntityContext", + "v2.SecurityMonitoringApi.getSecurityMonitoringDatasetVersionHistory", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -13068,27 +12697,29 @@ public ApiResponse getSingleEntityContextWithHttpIn localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a single entity context. + * Get the version history of a dataset. * - *

See {@link #getSingleEntityContextWithHttpInfo}. + *

See {@link #getSecurityMonitoringDatasetVersionHistoryWithHttpInfo}. * - * @param id The unique identifier of the entity to retrieve. (required) + * @param datasetId The UUID of the dataset. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SingleEntityContextResponse>> + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringDatasetVersionHistoryResponse>> */ - public CompletableFuture> - getSingleEntityContextWithHttpInfoAsync( - String id, GetSingleEntityContextOptionalParameters parameters) { + public CompletableFuture> + getSecurityMonitoringDatasetVersionHistoryWithHttpInfoAsync( + String datasetId, + GetSecurityMonitoringDatasetVersionHistoryOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "getSingleEntityContext"; + String operationId = "getSecurityMonitoringDatasetVersionHistory"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); @@ -13096,35 +12727,35 @@ public ApiResponse getSingleEntityContextWithHttpIn } Object localVarPostBody = null; - // verify the required parameter 'id' is set - if (id == null) { - CompletableFuture> result = + // verify the required parameter 'datasetId' is set + if (datasetId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'id' when calling getSingleEntityContext")); + 400, + "Missing the required parameter 'datasetId' when calling" + + " getSecurityMonitoringDatasetVersionHistory")); return result; } - String from = parameters.from; - String to = parameters.to; - String asOf = parameters.asOf; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/entity_context/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + "/api/v2/security_monitoring/datasets/{dataset_id}/version_history" + .replaceAll("\\{" + "dataset_id" + "\\}", apiClient.escapeString(datasetId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSingleEntityContext", + "v2.SecurityMonitoringApi.getSecurityMonitoringDatasetVersionHistory", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -13132,7 +12763,7 @@ public ApiResponse getSingleEntityContextWithHttpIn new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -13145,34 +12776,34 @@ public ApiResponse getSingleEntityContextWithHttpIn localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get default rulesets for a language. + * Get a hist signal's details. * - *

See {@link #getStaticAnalysisDefaultRulesetsWithHttpInfo}. + *

See {@link #getSecurityMonitoringHistsignalWithHttpInfo}. * - * @param language The programming language for which to retrieve the default rulesets. (required) - * @return DefaultRulesetsPerLanguageResponse + * @param histsignalId The ID of the historical signal. (required) + * @return SecurityMonitoringSignalResponse * @throws ApiException if fails to make API call */ - public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(String language) + public SecurityMonitoringSignalResponse getSecurityMonitoringHistsignal(String histsignalId) throws ApiException { - return getStaticAnalysisDefaultRulesetsWithHttpInfo(language).getData(); + return getSecurityMonitoringHistsignalWithHttpInfo(histsignalId).getData(); } /** - * Get default rulesets for a language. + * Get a hist signal's details. * - *

See {@link #getStaticAnalysisDefaultRulesetsWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringHistsignalWithHttpInfoAsync}. * - * @param language The programming language for which to retrieve the default rulesets. (required) - * @return CompletableFuture<DefaultRulesetsPerLanguageResponse> + * @param histsignalId The ID of the historical signal. (required) + * @return CompletableFuture<SecurityMonitoringSignalResponse> */ - public CompletableFuture - getStaticAnalysisDefaultRulesetsAsync(String language) { - return getStaticAnalysisDefaultRulesetsWithHttpInfoAsync(language) + public CompletableFuture getSecurityMonitoringHistsignalAsync( + String histsignalId) { + return getSecurityMonitoringHistsignalWithHttpInfoAsync(histsignalId) .thenApply( response -> { return response.getData(); @@ -13180,10 +12811,10 @@ public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(Strin } /** - * Get the default SAST ruleset names for a given programming language. + * Get a hist signal's details. * - * @param language The programming language for which to retrieve the default rulesets. (required) - * @return ApiResponse<DefaultRulesetsPerLanguageResponse> + * @param histsignalId The ID of the historical signal. (required) + * @return ApiResponse<SecurityMonitoringSignalResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -13191,13 +12822,15 @@ public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(Strin * * * + * + * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - getStaticAnalysisDefaultRulesetsWithHttpInfo(String language) throws ApiException { + public ApiResponse getSecurityMonitoringHistsignalWithHttpInfo( + String histsignalId) throws ApiException { // Check if unstable operation is enabled - String operationId = "getStaticAnalysisDefaultRulesets"; + String operationId = "getSecurityMonitoringHistsignal"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -13205,23 +12838,24 @@ public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(Strin } Object localVarPostBody = null; - // verify the required parameter 'language' is set - if (language == null) { + // verify the required parameter 'histsignalId' is set + if (histsignalId == null) { throw new ApiException( 400, - "Missing the required parameter 'language' when calling" - + " getStaticAnalysisDefaultRulesets"); + "Missing the required parameter 'histsignalId' when calling" + + " getSecurityMonitoringHistsignal"); } // create path and map variables String localVarPath = - "/api/v2/static-analysis/default-rulesets/{language}" - .replaceAll("\\{" + "language" + "\\}", apiClient.escapeString(language.toString())); + "/api/v2/siem-historical-detections/histsignals/{histsignal_id}" + .replaceAll( + "\\{" + "histsignal_id" + "\\}", apiClient.escapeString(histsignalId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getStaticAnalysisDefaultRulesets", + "v2.SecurityMonitoringApi.getSecurityMonitoringHistsignal", localVarPath, new ArrayList(), localVarHeaderParams, @@ -13236,25 +12870,25 @@ public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(Strin localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get default rulesets for a language. + * Get a hist signal's details. * - *

See {@link #getStaticAnalysisDefaultRulesetsWithHttpInfo}. + *

See {@link #getSecurityMonitoringHistsignalWithHttpInfo}. * - * @param language The programming language for which to retrieve the default rulesets. (required) - * @return CompletableFuture<ApiResponse<DefaultRulesetsPerLanguageResponse>> + * @param histsignalId The ID of the historical signal. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalResponse>> */ - public CompletableFuture> - getStaticAnalysisDefaultRulesetsWithHttpInfoAsync(String language) { + public CompletableFuture> + getSecurityMonitoringHistsignalWithHttpInfoAsync(String histsignalId) { // Check if unstable operation is enabled - String operationId = "getStaticAnalysisDefaultRulesets"; + String operationId = "getSecurityMonitoringHistsignal"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); @@ -13262,21 +12896,22 @@ public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(Strin } Object localVarPostBody = null; - // verify the required parameter 'language' is set - if (language == null) { - CompletableFuture> result = + // verify the required parameter 'histsignalId' is set + if (histsignalId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'language' when calling" - + " getStaticAnalysisDefaultRulesets")); + "Missing the required parameter 'histsignalId' when calling" + + " getSecurityMonitoringHistsignal")); return result; } // create path and map variables String localVarPath = - "/api/v2/static-analysis/default-rulesets/{language}" - .replaceAll("\\{" + "language" + "\\}", apiClient.escapeString(language.toString())); + "/api/v2/siem-historical-detections/histsignals/{histsignal_id}" + .replaceAll( + "\\{" + "histsignal_id" + "\\}", apiClient.escapeString(histsignalId.toString())); Map localVarHeaderParams = new HashMap(); @@ -13284,7 +12919,7 @@ public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(Strin try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getStaticAnalysisDefaultRulesets", + "v2.SecurityMonitoringApi.getSecurityMonitoringHistsignal", localVarPath, new ArrayList(), localVarHeaderParams, @@ -13292,7 +12927,7 @@ public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(Strin new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -13305,34 +12940,119 @@ public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(Strin localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getSecurityMonitoringHistsignalsByJobId. */ + public static class GetSecurityMonitoringHistsignalsByJobIdOptionalParameters { + private String filterQuery; + private OffsetDateTime filterFrom; + private OffsetDateTime filterTo; + private SecurityMonitoringSignalsSort sort; + private String pageCursor; + private Integer pageLimit; + + /** + * Set filterQuery. + * + * @param filterQuery The search query for security signals. (optional) + * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters + */ + public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters filterQuery( + String filterQuery) { + this.filterQuery = filterQuery; + return this; + } + + /** + * Set filterFrom. + * + * @param filterFrom The minimum timestamp for requested security signals. (optional) + * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters + */ + public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters filterFrom( + OffsetDateTime filterFrom) { + this.filterFrom = filterFrom; + return this; + } + + /** + * Set filterTo. + * + * @param filterTo The maximum timestamp for requested security signals. (optional) + * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters + */ + public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters filterTo( + OffsetDateTime filterTo) { + this.filterTo = filterTo; + return this; + } + + /** + * Set sort. + * + * @param sort The order of the security signals in results. (optional) + * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters + */ + public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters sort( + SecurityMonitoringSignalsSort sort) { + this.sort = sort; + return this; + } + + /** + * Set pageCursor. + * + * @param pageCursor A list of results using the cursor provided in the previous query. + * (optional) + * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters + */ + public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; + return this; + } + + /** + * Set pageLimit. + * + * @param pageLimit The maximum number of security signals in the response. (optional, default + * to 10) + * @return GetSecurityMonitoringHistsignalsByJobIdOptionalParameters + */ + public GetSecurityMonitoringHistsignalsByJobIdOptionalParameters pageLimit(Integer pageLimit) { + this.pageLimit = pageLimit; + return this; + } } /** - * Get node types for a language. + * Get a job's hist signals. * - *

See {@link #getStaticAnalysisNodeTypesWithHttpInfo}. + *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfo}. * - * @param language The programming language for which to retrieve node type definitions. - * (required) - * @return NodeTypesResponse + * @param jobId The ID of the job. (required) + * @return SecurityMonitoringSignalsListResponse * @throws ApiException if fails to make API call */ - public NodeTypesResponse getStaticAnalysisNodeTypes(String language) throws ApiException { - return getStaticAnalysisNodeTypesWithHttpInfo(language).getData(); + public SecurityMonitoringSignalsListResponse getSecurityMonitoringHistsignalsByJobId(String jobId) + throws ApiException { + return getSecurityMonitoringHistsignalsByJobIdWithHttpInfo( + jobId, new GetSecurityMonitoringHistsignalsByJobIdOptionalParameters()) + .getData(); } /** - * Get node types for a language. + * Get a job's hist signals. * - *

See {@link #getStaticAnalysisNodeTypesWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync}. * - * @param language The programming language for which to retrieve node type definitions. - * (required) - * @return CompletableFuture<NodeTypesResponse> + * @param jobId The ID of the job. (required) + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> */ - public CompletableFuture getStaticAnalysisNodeTypesAsync(String language) { - return getStaticAnalysisNodeTypesWithHttpInfoAsync(language) + public CompletableFuture + getSecurityMonitoringHistsignalsByJobIdAsync(String jobId) { + return getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync( + jobId, new GetSecurityMonitoringHistsignalsByJobIdOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -13340,26 +13060,64 @@ public CompletableFuture getStaticAnalysisNodeTypesAsync(Stri } /** - * Retrieve tree-sitter node type definitions for a given programming language. + * Get a job's hist signals. * - * @param language The programming language for which to retrieve node type definitions. - * (required) - * @return ApiResponse<NodeTypesResponse> - * @throws ApiException if fails to make API call + *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfo}. + * + * @param jobId The ID of the job. (required) + * @param parameters Optional parameters for the request. + * @return SecurityMonitoringSignalsListResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringSignalsListResponse getSecurityMonitoringHistsignalsByJobId( + String jobId, GetSecurityMonitoringHistsignalsByJobIdOptionalParameters parameters) + throws ApiException { + return getSecurityMonitoringHistsignalsByJobIdWithHttpInfo(jobId, parameters).getData(); + } + + /** + * Get a job's hist signals. + * + *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync}. + * + * @param jobId The ID of the job. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + */ + public CompletableFuture + getSecurityMonitoringHistsignalsByJobIdAsync( + String jobId, GetSecurityMonitoringHistsignalsByJobIdOptionalParameters parameters) { + return getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync(jobId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a job's hist signals. + * + * @param jobId The ID of the job. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<SecurityMonitoringSignalsListResponse> + * @throws ApiException if fails to make API call * @http.response.details * * * * * - * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getStaticAnalysisNodeTypesWithHttpInfo(String language) - throws ApiException { + public ApiResponse + getSecurityMonitoringHistsignalsByJobIdWithHttpInfo( + String jobId, GetSecurityMonitoringHistsignalsByJobIdOptionalParameters parameters) + throws ApiException { // Check if unstable operation is enabled - String operationId = "getStaticAnalysisNodeTypes"; + String operationId = "getSecurityMonitoringHistsignalsByJobId"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -13367,23 +13125,39 @@ public ApiResponse getStaticAnalysisNodeTypesWithHttpInfo(Str } Object localVarPostBody = null; - // verify the required parameter 'language' is set - if (language == null) { + // verify the required parameter 'jobId' is set + if (jobId == null) { throw new ApiException( - 400, "Missing the required parameter 'language' when calling getStaticAnalysisNodeTypes"); + 400, + "Missing the required parameter 'jobId' when calling" + + " getSecurityMonitoringHistsignalsByJobId"); } + String filterQuery = parameters.filterQuery; + OffsetDateTime filterFrom = parameters.filterFrom; + OffsetDateTime filterTo = parameters.filterTo; + SecurityMonitoringSignalsSort sort = parameters.sort; + String pageCursor = parameters.pageCursor; + Integer pageLimit = parameters.pageLimit; // create path and map variables String localVarPath = - "/api/v2/static-analysis/static-analysis-server/node-types/{language}" - .replaceAll("\\{" + "language" + "\\}", apiClient.escapeString(language.toString())); + "/api/v2/siem-historical-detections/jobs/{job_id}/histsignals" + .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getStaticAnalysisNodeTypes", + "v2.SecurityMonitoringApi.getSecurityMonitoringHistsignalsByJobId", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -13396,61 +13170,80 @@ public ApiResponse getStaticAnalysisNodeTypesWithHttpInfo(Str localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get node types for a language. + * Get a job's hist signals. * - *

See {@link #getStaticAnalysisNodeTypesWithHttpInfo}. + *

See {@link #getSecurityMonitoringHistsignalsByJobIdWithHttpInfo}. * - * @param language The programming language for which to retrieve node type definitions. - * (required) - * @return CompletableFuture<ApiResponse<NodeTypesResponse>> + * @param jobId The ID of the job. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> */ - public CompletableFuture> - getStaticAnalysisNodeTypesWithHttpInfoAsync(String language) { + public CompletableFuture> + getSecurityMonitoringHistsignalsByJobIdWithHttpInfoAsync( + String jobId, GetSecurityMonitoringHistsignalsByJobIdOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "getStaticAnalysisNodeTypes"; + String operationId = "getSecurityMonitoringHistsignalsByJobId"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - // verify the required parameter 'language' is set - if (language == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'jobId' is set + if (jobId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'language' when calling getStaticAnalysisNodeTypes")); + "Missing the required parameter 'jobId' when calling" + + " getSecurityMonitoringHistsignalsByJobId")); return result; } + String filterQuery = parameters.filterQuery; + OffsetDateTime filterFrom = parameters.filterFrom; + OffsetDateTime filterTo = parameters.filterTo; + SecurityMonitoringSignalsSort sort = parameters.sort; + String pageCursor = parameters.pageCursor; + Integer pageLimit = parameters.pageLimit; // create path and map variables String localVarPath = - "/api/v2/static-analysis/static-analysis-server/node-types/{language}" - .replaceAll("\\{" + "language" + "\\}", apiClient.escapeString(language.toString())); + "/api/v2/siem-historical-detections/jobs/{job_id}/histsignals" + .replaceAll("\\{" + "job_id" + "\\}", apiClient.escapeString(jobId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getStaticAnalysisNodeTypes", + "v2.SecurityMonitoringApi.getSecurityMonitoringHistsignalsByJobId", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -13462,100 +13255,34 @@ public ApiResponse getStaticAnalysisNodeTypesWithHttpInfo(Str localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to getStaticAnalysisRuleset. */ - public static class GetStaticAnalysisRulesetOptionalParameters { - private Boolean includeTests; - private Boolean includeTestingRules; - - /** - * Set includeTests. - * - * @param includeTests When true, test cases for each rule are included in the response. - * (optional) - * @return GetStaticAnalysisRulesetOptionalParameters - */ - public GetStaticAnalysisRulesetOptionalParameters includeTests(Boolean includeTests) { - this.includeTests = includeTests; - return this; - } - - /** - * Set includeTestingRules. - * - * @param includeTestingRules When true, rules that are in testing mode are included in the - * response. (optional) - * @return GetStaticAnalysisRulesetOptionalParameters - */ - public GetStaticAnalysisRulesetOptionalParameters includeTestingRules( - Boolean includeTestingRules) { - this.includeTestingRules = includeTestingRules; - return this; - } - } - - /** - * Get a SAST ruleset. - * - *

See {@link #getStaticAnalysisRulesetWithHttpInfo}. - * - * @param rulesetName The name of the ruleset to retrieve. (required) - * @return SastRulesetResponse - * @throws ApiException if fails to make API call - */ - public SastRulesetResponse getStaticAnalysisRuleset(String rulesetName) throws ApiException { - return getStaticAnalysisRulesetWithHttpInfo( - rulesetName, new GetStaticAnalysisRulesetOptionalParameters()) - .getData(); - } - - /** - * Get a SAST ruleset. - * - *

See {@link #getStaticAnalysisRulesetWithHttpInfoAsync}. - * - * @param rulesetName The name of the ruleset to retrieve. (required) - * @return CompletableFuture<SastRulesetResponse> - */ - public CompletableFuture getStaticAnalysisRulesetAsync(String rulesetName) { - return getStaticAnalysisRulesetWithHttpInfoAsync( - rulesetName, new GetStaticAnalysisRulesetOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType() {}); } /** - * Get a SAST ruleset. + * Get an entity context sync configuration. * - *

See {@link #getStaticAnalysisRulesetWithHttpInfo}. + *

See {@link #getSecurityMonitoringIntegrationConfigWithHttpInfo}. * - * @param rulesetName The name of the ruleset to retrieve. (required) - * @param parameters Optional parameters for the request. - * @return SastRulesetResponse + * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @return SecurityMonitoringIntegrationConfigResponse * @throws ApiException if fails to make API call */ - public SastRulesetResponse getStaticAnalysisRuleset( - String rulesetName, GetStaticAnalysisRulesetOptionalParameters parameters) - throws ApiException { - return getStaticAnalysisRulesetWithHttpInfo(rulesetName, parameters).getData(); + public SecurityMonitoringIntegrationConfigResponse getSecurityMonitoringIntegrationConfig( + String integrationConfigId) throws ApiException { + return getSecurityMonitoringIntegrationConfigWithHttpInfo(integrationConfigId).getData(); } /** - * Get a SAST ruleset. + * Get an entity context sync configuration. * - *

See {@link #getStaticAnalysisRulesetWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringIntegrationConfigWithHttpInfoAsync}. * - * @param rulesetName The name of the ruleset to retrieve. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<SastRulesetResponse> + * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @return CompletableFuture<SecurityMonitoringIntegrationConfigResponse> */ - public CompletableFuture getStaticAnalysisRulesetAsync( - String rulesetName, GetStaticAnalysisRulesetOptionalParameters parameters) { - return getStaticAnalysisRulesetWithHttpInfoAsync(rulesetName, parameters) + public CompletableFuture + getSecurityMonitoringIntegrationConfigAsync(String integrationConfigId) { + return getSecurityMonitoringIntegrationConfigWithHttpInfoAsync(integrationConfigId) .thenApply( response -> { return response.getData(); @@ -13563,27 +13290,26 @@ public CompletableFuture getStaticAnalysisRulesetAsync( } /** - * Get a SAST ruleset by name, including all its rules. + * Get the details of a specific entity context sync configuration. * - * @param rulesetName The name of the ruleset to retrieve. (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<SastRulesetResponse> + * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @return ApiResponse<SecurityMonitoringIntegrationConfigResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * + * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getStaticAnalysisRulesetWithHttpInfo( - String rulesetName, GetStaticAnalysisRulesetOptionalParameters parameters) - throws ApiException { + public ApiResponse + getSecurityMonitoringIntegrationConfigWithHttpInfo(String integrationConfigId) + throws ApiException { // Check if unstable operation is enabled - String operationId = "getStaticAnalysisRuleset"; + String operationId = "getSecurityMonitoringIntegrationConfig"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -13591,32 +13317,27 @@ public ApiResponse getStaticAnalysisRulesetWithHttpInfo( } Object localVarPostBody = null; - // verify the required parameter 'rulesetName' is set - if (rulesetName == null) { + // verify the required parameter 'integrationConfigId' is set + if (integrationConfigId == null) { throw new ApiException( 400, - "Missing the required parameter 'rulesetName' when calling getStaticAnalysisRuleset"); - } - Boolean includeTests = parameters.includeTests; - Boolean includeTestingRules = parameters.includeTestingRules; + "Missing the required parameter 'integrationConfigId' when calling" + + " getSecurityMonitoringIntegrationConfig"); + } // create path and map variables String localVarPath = - "/api/v2/static-analysis/rulesets/{ruleset_name}" + "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" .replaceAll( - "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString())); + "\\{" + "integration_config_id" + "\\}", + apiClient.escapeString(integrationConfigId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_tests", includeTests)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "include_testing_rules", includeTestingRules)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getStaticAnalysisRuleset", + "v2.SecurityMonitoringApi.getSecurityMonitoringIntegrationConfig", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -13629,71 +13350,66 @@ public ApiResponse getStaticAnalysisRulesetWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a SAST ruleset. + * Get an entity context sync configuration. * - *

See {@link #getStaticAnalysisRulesetWithHttpInfo}. + *

See {@link #getSecurityMonitoringIntegrationConfigWithHttpInfo}. * - * @param rulesetName The name of the ruleset to retrieve. (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SastRulesetResponse>> + * @param integrationConfigId The ID of the entity context sync configuration. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringIntegrationConfigResponse>> */ - public CompletableFuture> - getStaticAnalysisRulesetWithHttpInfoAsync( - String rulesetName, GetStaticAnalysisRulesetOptionalParameters parameters) { + public CompletableFuture> + getSecurityMonitoringIntegrationConfigWithHttpInfoAsync(String integrationConfigId) { // Check if unstable operation is enabled - String operationId = "getStaticAnalysisRuleset"; + String operationId = "getSecurityMonitoringIntegrationConfig"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - // verify the required parameter 'rulesetName' is set - if (rulesetName == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'integrationConfigId' is set + if (integrationConfigId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'rulesetName' when calling" - + " getStaticAnalysisRuleset")); + "Missing the required parameter 'integrationConfigId' when calling" + + " getSecurityMonitoringIntegrationConfig")); return result; } - Boolean includeTests = parameters.includeTests; - Boolean includeTestingRules = parameters.includeTestingRules; // create path and map variables String localVarPath = - "/api/v2/static-analysis/rulesets/{ruleset_name}" + "/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}" .replaceAll( - "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString())); + "\\{" + "integration_config_id" + "\\}", + apiClient.escapeString(integrationConfigId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_tests", includeTests)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "include_testing_rules", includeTestingRules)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getStaticAnalysisRuleset", + "v2.SecurityMonitoringApi.getSecurityMonitoringIntegrationConfig", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -13705,32 +13421,34 @@ public ApiResponse getStaticAnalysisRulesetWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get tree-sitter WASM file. + * Get a rule's details. * - *

See {@link #getStaticAnalysisTreeSitterWasmWithHttpInfo}. + *

See {@link #getSecurityMonitoringRuleWithHttpInfo}. * - * @param file The name of the WASM file to download. (required) - * @return File + * @param ruleId The ID of the rule. (required) + * @return SecurityMonitoringRuleResponse * @throws ApiException if fails to make API call */ - public File getStaticAnalysisTreeSitterWasm(String file) throws ApiException { - return getStaticAnalysisTreeSitterWasmWithHttpInfo(file).getData(); + public SecurityMonitoringRuleResponse getSecurityMonitoringRule(String ruleId) + throws ApiException { + return getSecurityMonitoringRuleWithHttpInfo(ruleId).getData(); } /** - * Get tree-sitter WASM file. + * Get a rule's details. * - *

See {@link #getStaticAnalysisTreeSitterWasmWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringRuleWithHttpInfoAsync}. * - * @param file The name of the WASM file to download. (required) - * @return CompletableFuture<File> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<SecurityMonitoringRuleResponse> */ - public CompletableFuture getStaticAnalysisTreeSitterWasmAsync(String file) { - return getStaticAnalysisTreeSitterWasmWithHttpInfoAsync(file) + public CompletableFuture getSecurityMonitoringRuleAsync( + String ruleId) { + return getSecurityMonitoringRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -13738,53 +13456,44 @@ public CompletableFuture getStaticAnalysisTreeSitterWasmAsync(String file) } /** - * Download the WebAssembly binary for a tree-sitter grammar by file name. + * Get a rule's details. * - * @param file The name of the WASM file to download. (required) - * @return ApiResponse<File> + * @param ruleId The ID of the rule. (required) + * @return ApiResponse<SecurityMonitoringRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * + * + * * *
Response details
Status Code Description Response Headers
200 BLOB with the content of the WASM file -
400 Bad Request -
401 Unauthorized -
200 OK -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getStaticAnalysisTreeSitterWasmWithHttpInfo(String file) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "getStaticAnalysisTreeSitterWasm"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } + public ApiResponse getSecurityMonitoringRuleWithHttpInfo( + String ruleId) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'file' is set - if (file == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( - 400, - "Missing the required parameter 'file' when calling getStaticAnalysisTreeSitterWasm"); + 400, "Missing the required parameter 'ruleId' when calling getSecurityMonitoringRule"); } // create path and map variables String localVarPath = - "/api/v2/static-analysis/static-analysis-server/tree-sitter-wasm/{file}" - .replaceAll("\\{" + "file" + "\\}", apiClient.escapeString(file.toString())); + "/api/v2/security_monitoring/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getStaticAnalysisTreeSitterWasm", + "v2.SecurityMonitoringApi.getSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/octet-stream", "application/json"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", @@ -13794,45 +13503,35 @@ public ApiResponse getStaticAnalysisTreeSitterWasmWithHttpInfo(String file localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get tree-sitter WASM file. + * Get a rule's details. * - *

See {@link #getStaticAnalysisTreeSitterWasmWithHttpInfo}. + *

See {@link #getSecurityMonitoringRuleWithHttpInfo}. * - * @param file The name of the WASM file to download. (required) - * @return CompletableFuture<ApiResponse<File>> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleResponse>> */ - public CompletableFuture> getStaticAnalysisTreeSitterWasmWithHttpInfoAsync( - String file) { - // Check if unstable operation is enabled - String operationId = "getStaticAnalysisTreeSitterWasm"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> + getSecurityMonitoringRuleWithHttpInfoAsync(String ruleId) { Object localVarPostBody = null; - // verify the required parameter 'file' is set - if (file == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'file' when calling" - + " getStaticAnalysisTreeSitterWasm")); + "Missing the required parameter 'ruleId' when calling getSecurityMonitoringRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/static-analysis/static-analysis-server/tree-sitter-wasm/{file}" - .replaceAll("\\{" + "file" + "\\}", apiClient.escapeString(file.toString())); + "/api/v2/security_monitoring/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -13840,15 +13539,16 @@ public CompletableFuture> getStaticAnalysisTreeSitterWasmWithH try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getStaticAnalysisTreeSitterWasm", + "v2.SecurityMonitoringApi.getSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/octet-stream", "application/json"}, + new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -13860,34 +13560,34 @@ public CompletableFuture> getStaticAnalysisTreeSitterWasmWithH localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get suggested actions for a signal. + * Get a signal's details. * - *

See {@link #getSuggestedActionsMatchingSignalWithHttpInfo}. + *

See {@link #getSecurityMonitoringSignalWithHttpInfo}. * * @param signalId The ID of the signal. (required) - * @return SecurityMonitoringSignalSuggestedActionsResponse + * @return SecurityMonitoringSignalResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalSuggestedActionsResponse getSuggestedActionsMatchingSignal( - String signalId) throws ApiException { - return getSuggestedActionsMatchingSignalWithHttpInfo(signalId).getData(); + public SecurityMonitoringSignalResponse getSecurityMonitoringSignal(String signalId) + throws ApiException { + return getSecurityMonitoringSignalWithHttpInfo(signalId).getData(); } /** - * Get suggested actions for a signal. + * Get a signal's details. * - *

See {@link #getSuggestedActionsMatchingSignalWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringSignalWithHttpInfoAsync}. * * @param signalId The ID of the signal. (required) - * @return CompletableFuture<SecurityMonitoringSignalSuggestedActionsResponse> + * @return CompletableFuture<SecurityMonitoringSignalResponse> */ - public CompletableFuture - getSuggestedActionsMatchingSignalAsync(String signalId) { - return getSuggestedActionsMatchingSignalWithHttpInfoAsync(signalId) + public CompletableFuture getSecurityMonitoringSignalAsync( + String signalId) { + return getSecurityMonitoringSignalWithHttpInfoAsync(signalId) .thenApply( response -> { return response.getData(); @@ -13895,10 +13595,10 @@ public SecurityMonitoringSignalSuggestedActionsResponse getSuggestedActionsMatch } /** - * Get the list of suggested actions for a given security signal. + * Get a signal's details. * * @param signalId The ID of the signal. (required) - * @return ApiResponse<SecurityMonitoringSignalSuggestedActionsResponse> + * @return ApiResponse<SecurityMonitoringSignalResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -13910,27 +13610,26 @@ public SecurityMonitoringSignalSuggestedActionsResponse getSuggestedActionsMatch * *
429 Too many requests -
*/ - public ApiResponse - getSuggestedActionsMatchingSignalWithHttpInfo(String signalId) throws ApiException { + public ApiResponse getSecurityMonitoringSignalWithHttpInfo( + String signalId) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'signalId' is set if (signalId == null) { throw new ApiException( 400, - "Missing the required parameter 'signalId' when calling" - + " getSuggestedActionsMatchingSignal"); + "Missing the required parameter 'signalId' when calling getSecurityMonitoringSignal"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/suggested_actions" + "/api/v2/security_monitoring/signals/{signal_id}" .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSuggestedActionsMatchingSignal", + "v2.SecurityMonitoringApi.getSecurityMonitoringSignal", localVarPath, new ArrayList(), localVarHeaderParams, @@ -13945,36 +13644,35 @@ public SecurityMonitoringSignalSuggestedActionsResponse getSuggestedActionsMatch localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get suggested actions for a signal. + * Get a signal's details. * - *

See {@link #getSuggestedActionsMatchingSignalWithHttpInfo}. + *

See {@link #getSecurityMonitoringSignalWithHttpInfo}. * * @param signalId The ID of the signal. (required) - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringSignalSuggestedActionsResponse>> + * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalResponse>> */ - public CompletableFuture> - getSuggestedActionsMatchingSignalWithHttpInfoAsync(String signalId) { + public CompletableFuture> + getSecurityMonitoringSignalWithHttpInfoAsync(String signalId) { Object localVarPostBody = null; // verify the required parameter 'signalId' is set if (signalId == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'signalId' when calling" - + " getSuggestedActionsMatchingSignal")); + + " getSecurityMonitoringSignal")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/signals/{signal_id}/suggested_actions" + "/api/v2/security_monitoring/signals/{signal_id}" .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); Map localVarHeaderParams = new HashMap(); @@ -13983,7 +13681,7 @@ public SecurityMonitoringSignalSuggestedActionsResponse getSuggestedActionsMatch try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSuggestedActionsMatchingSignal", + "v2.SecurityMonitoringApi.getSecurityMonitoringSignal", localVarPath, new ArrayList(), localVarHeaderParams, @@ -13991,7 +13689,7 @@ public SecurityMonitoringSignalSuggestedActionsResponse getSuggestedActionsMatch new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -14004,34 +13702,34 @@ public SecurityMonitoringSignalSuggestedActionsResponse getSuggestedActionsMatch localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get suppressions affecting future rule. + * Get a suppression rule. * - *

See {@link #getSuppressionsAffectingFutureRuleWithHttpInfo}. + *

See {@link #getSecurityMonitoringSuppressionWithHttpInfo}. * - * @param body (required) - * @return SecurityMonitoringSuppressionsResponse + * @param suppressionId The ID of the suppression rule (required) + * @return SecurityMonitoringSuppressionResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingFutureRule( - SecurityMonitoringRuleCreatePayload body) throws ApiException { - return getSuppressionsAffectingFutureRuleWithHttpInfo(body).getData(); + public SecurityMonitoringSuppressionResponse getSecurityMonitoringSuppression( + String suppressionId) throws ApiException { + return getSecurityMonitoringSuppressionWithHttpInfo(suppressionId).getData(); } /** - * Get suppressions affecting future rule. + * Get a suppression rule. * - *

See {@link #getSuppressionsAffectingFutureRuleWithHttpInfoAsync}. + *

See {@link #getSecurityMonitoringSuppressionWithHttpInfoAsync}. * - * @param body (required) - * @return CompletableFuture<SecurityMonitoringSuppressionsResponse> + * @param suppressionId The ID of the suppression rule (required) + * @return CompletableFuture<SecurityMonitoringSuppressionResponse> */ - public CompletableFuture - getSuppressionsAffectingFutureRuleAsync(SecurityMonitoringRuleCreatePayload body) { - return getSuppressionsAffectingFutureRuleWithHttpInfoAsync(body) + public CompletableFuture + getSecurityMonitoringSuppressionAsync(String suppressionId) { + return getSecurityMonitoringSuppressionWithHttpInfoAsync(suppressionId) .thenApply( response -> { return response.getData(); @@ -14039,40 +13737,43 @@ public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingFutureRule } /** - * Get the list of suppressions that would affect a rule. + * Get the details of a specific suppression rule. * - * @param body (required) - * @return ApiResponse<SecurityMonitoringSuppressionsResponse> + * @param suppressionId The ID of the suppression rule (required) + * @return ApiResponse<SecurityMonitoringSuppressionResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - getSuppressionsAffectingFutureRuleWithHttpInfo(SecurityMonitoringRuleCreatePayload body) - throws ApiException { - Object localVarPostBody = body; + public ApiResponse + getSecurityMonitoringSuppressionWithHttpInfo(String suppressionId) throws ApiException { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { throw new ApiException( 400, - "Missing the required parameter 'body' when calling getSuppressionsAffectingFutureRule"); + "Missing the required parameter 'suppressionId' when calling" + + " getSecurityMonitoringSuppression"); } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/suppressions/rules"; + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSuppressionsAffectingFutureRule", + "v2.SecurityMonitoringApi.getSecurityMonitoringSuppression", localVarPath, new ArrayList(), localVarHeaderParams, @@ -14080,42 +13781,44 @@ public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingFutureRule new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "GET", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get suppressions affecting future rule. + * Get a suppression rule. * - *

See {@link #getSuppressionsAffectingFutureRuleWithHttpInfo}. + *

See {@link #getSecurityMonitoringSuppressionWithHttpInfo}. * - * @param body (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionsResponse>> + * @param suppressionId The ID of the suppression rule (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionResponse>> */ - public CompletableFuture> - getSuppressionsAffectingFutureRuleWithHttpInfoAsync( - SecurityMonitoringRuleCreatePayload body) { - Object localVarPostBody = body; + public CompletableFuture> + getSecurityMonitoringSuppressionWithHttpInfoAsync(String suppressionId) { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling" - + " getSuppressionsAffectingFutureRule")); + "Missing the required parameter 'suppressionId' when calling" + + " getSecurityMonitoringSuppression")); return result; } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/suppressions/rules"; + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); Map localVarHeaderParams = new HashMap(); @@ -14123,7 +13826,7 @@ public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingFutureRule try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSuppressionsAffectingFutureRule", + "v2.SecurityMonitoringApi.getSecurityMonitoringSuppression", localVarPath, new ArrayList(), localVarHeaderParams, @@ -14131,47 +13834,62 @@ public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingFutureRule new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "GET", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getSignalEntities. */ + public static class GetSignalEntitiesOptionalParameters { + private Integer limit; + + /** + * Set limit. + * + * @param limit The maximum number of entities to return. (optional, default to 10) + * @return GetSignalEntitiesOptionalParameters + */ + public GetSignalEntitiesOptionalParameters limit(Integer limit) { + this.limit = limit; + return this; + } } /** - * Get suppressions affecting a specific rule. + * Get entities related to a signal. * - *

See {@link #getSuppressionsAffectingRuleWithHttpInfo}. + *

See {@link #getSignalEntitiesWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @return SecurityMonitoringSuppressionsResponse + * @param signalId The ID of the signal. (required) + * @return SignalEntitiesResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingRule(String ruleId) - throws ApiException { - return getSuppressionsAffectingRuleWithHttpInfo(ruleId).getData(); + public SignalEntitiesResponse getSignalEntities(String signalId) throws ApiException { + return getSignalEntitiesWithHttpInfo(signalId, new GetSignalEntitiesOptionalParameters()) + .getData(); } /** - * Get suppressions affecting a specific rule. + * Get entities related to a signal. * - *

See {@link #getSuppressionsAffectingRuleWithHttpInfoAsync}. + *

See {@link #getSignalEntitiesWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) - * @return CompletableFuture<SecurityMonitoringSuppressionsResponse> + * @param signalId The ID of the signal. (required) + * @return CompletableFuture<SignalEntitiesResponse> */ - public CompletableFuture - getSuppressionsAffectingRuleAsync(String ruleId) { - return getSuppressionsAffectingRuleWithHttpInfoAsync(ruleId) + public CompletableFuture getSignalEntitiesAsync(String signalId) { + return getSignalEntitiesWithHttpInfoAsync(signalId, new GetSignalEntitiesOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -14179,42 +13897,88 @@ public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingRule(Strin } /** - * Get the list of suppressions that affect a specific existing rule by its ID. + * Get entities related to a signal. * - * @param ruleId The ID of the rule. (required) - * @return ApiResponse<SecurityMonitoringSuppressionsResponse> + *

See {@link #getSignalEntitiesWithHttpInfo}. + * + * @param signalId The ID of the signal. (required) + * @param parameters Optional parameters for the request. + * @return SignalEntitiesResponse + * @throws ApiException if fails to make API call + */ + public SignalEntitiesResponse getSignalEntities( + String signalId, GetSignalEntitiesOptionalParameters parameters) throws ApiException { + return getSignalEntitiesWithHttpInfo(signalId, parameters).getData(); + } + + /** + * Get entities related to a signal. + * + *

See {@link #getSignalEntitiesWithHttpInfoAsync}. + * + * @param signalId The ID of the signal. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SignalEntitiesResponse> + */ + public CompletableFuture getSignalEntitiesAsync( + String signalId, GetSignalEntitiesOptionalParameters parameters) { + return getSignalEntitiesWithHttpInfoAsync(signalId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of entities related to a security signal, captured at the signal's timestamp. + * + * @param signalId The ID of the signal. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<SignalEntitiesResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - getSuppressionsAffectingRuleWithHttpInfo(String ruleId) throws ApiException { + public ApiResponse getSignalEntitiesWithHttpInfo( + String signalId, GetSignalEntitiesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getSignalEntities"; + 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 'ruleId' is set - if (ruleId == null) { + // verify the required parameter 'signalId' is set + if (signalId == null) { throw new ApiException( - 400, "Missing the required parameter 'ruleId' when calling getSuppressionsAffectingRule"); + 400, "Missing the required parameter 'signalId' when calling getSignalEntities"); } + Integer limit = parameters.limit; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/rules/{rule_id}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + "/api/v2/security_monitoring/signals/{signal_id}/entities" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSuppressionsAffectingRule", + "v2.SecurityMonitoringApi.getSignalEntities", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -14227,52 +13991,64 @@ public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingRule(Strin localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get suppressions affecting a specific rule. + * Get entities related to a signal. * - *

See {@link #getSuppressionsAffectingRuleWithHttpInfo}. + *

See {@link #getSignalEntitiesWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionsResponse>> + * @param signalId The ID of the signal. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SignalEntitiesResponse>> */ - public CompletableFuture> - getSuppressionsAffectingRuleWithHttpInfoAsync(String ruleId) { + public CompletableFuture> getSignalEntitiesWithHttpInfoAsync( + String signalId, GetSignalEntitiesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getSignalEntities"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - // verify the required parameter 'ruleId' is set - if (ruleId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'ruleId' when calling getSuppressionsAffectingRule")); + 400, "Missing the required parameter 'signalId' when calling getSignalEntities")); return result; } + Integer limit = parameters.limit; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/rules/{rule_id}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + "/api/v2/security_monitoring/signals/{signal_id}/entities" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSuppressionsAffectingRule", + "v2.SecurityMonitoringApi.getSignalEntities", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -14284,100 +14060,32 @@ public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingRule(Strin localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to getSuppressionVersionHistory. */ - public static class GetSuppressionVersionHistoryOptionalParameters { - private Long pageSize; - private Long pageNumber; - - /** - * Set pageSize. - * - * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default - * to 10) - * @return GetSuppressionVersionHistoryOptionalParameters - */ - public GetSuppressionVersionHistoryOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; - return this; - } - - /** - * Set pageNumber. - * - * @param pageNumber Specific page number to return. (optional, default to 0) - * @return GetSuppressionVersionHistoryOptionalParameters - */ - public GetSuppressionVersionHistoryOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; - return this; - } - } - - /** - * Get a suppression's version history. - * - *

See {@link #getSuppressionVersionHistoryWithHttpInfo}. - * - * @param suppressionId The ID of the suppression rule (required) - * @return GetSuppressionVersionHistoryResponse - * @throws ApiException if fails to make API call - */ - public GetSuppressionVersionHistoryResponse getSuppressionVersionHistory(String suppressionId) - throws ApiException { - return getSuppressionVersionHistoryWithHttpInfo( - suppressionId, new GetSuppressionVersionHistoryOptionalParameters()) - .getData(); - } - - /** - * Get a suppression's version history. - * - *

See {@link #getSuppressionVersionHistoryWithHttpInfoAsync}. - * - * @param suppressionId The ID of the suppression rule (required) - * @return CompletableFuture<GetSuppressionVersionHistoryResponse> - */ - public CompletableFuture getSuppressionVersionHistoryAsync( - String suppressionId) { - return getSuppressionVersionHistoryWithHttpInfoAsync( - suppressionId, new GetSuppressionVersionHistoryOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType() {}); } /** - * Get a suppression's version history. + * Get details of a signal-based notification rule. * - *

See {@link #getSuppressionVersionHistoryWithHttpInfo}. + *

See {@link #getSignalNotificationRuleWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) - * @param parameters Optional parameters for the request. - * @return GetSuppressionVersionHistoryResponse + * @param id ID of the notification rule. (required) + * @return NotificationRuleResponse * @throws ApiException if fails to make API call */ - public GetSuppressionVersionHistoryResponse getSuppressionVersionHistory( - String suppressionId, GetSuppressionVersionHistoryOptionalParameters parameters) - throws ApiException { - return getSuppressionVersionHistoryWithHttpInfo(suppressionId, parameters).getData(); + public NotificationRuleResponse getSignalNotificationRule(String id) throws ApiException { + return getSignalNotificationRuleWithHttpInfo(id).getData(); } /** - * Get a suppression's version history. + * Get details of a signal-based notification rule. * - *

See {@link #getSuppressionVersionHistoryWithHttpInfoAsync}. + *

See {@link #getSignalNotificationRuleWithHttpInfoAsync}. * - * @param suppressionId The ID of the suppression rule (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<GetSuppressionVersionHistoryResponse> + * @param id ID of the notification rule. (required) + * @return CompletableFuture<NotificationRuleResponse> */ - public CompletableFuture getSuppressionVersionHistoryAsync( - String suppressionId, GetSuppressionVersionHistoryOptionalParameters parameters) { - return getSuppressionVersionHistoryWithHttpInfoAsync(suppressionId, parameters) + public CompletableFuture getSignalNotificationRuleAsync(String id) { + return getSignalNotificationRuleWithHttpInfoAsync(id) .thenApply( response -> { return response.getData(); @@ -14385,57 +14093,47 @@ public CompletableFuture getSuppressionVer } /** - * Get a suppression's version history. + * Get the details of a notification rule for security signals. * - * @param suppressionId The ID of the suppression rule (required) - * @param parameters Optional parameters for the request. - * @return ApiResponse<GetSuppressionVersionHistoryResponse> + * @param id ID of the notification rule. (required) + * @return ApiResponse<NotificationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * + * * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
200 Notification rule details. -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getSuppressionVersionHistoryWithHttpInfo( - String suppressionId, GetSuppressionVersionHistoryOptionalParameters parameters) + public ApiResponse getSignalNotificationRuleWithHttpInfo(String id) throws ApiException { Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { + // verify the required parameter 'id' is set + if (id == null) { throw new ApiException( - 400, - "Missing the required parameter 'suppressionId' when calling" - + " getSuppressionVersionHistory"); + 400, "Missing the required parameter 'id' when calling getSignalNotificationRule"); } - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history" - .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "/api/v2/security/signals/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSuppressionVersionHistory", + "v2.SecurityMonitoringApi.getSignalNotificationRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -14444,62 +14142,49 @@ public ApiResponse getSuppressionVersionHi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a suppression's version history. + * Get details of a signal-based notification rule. * - *

See {@link #getSuppressionVersionHistoryWithHttpInfo}. + *

See {@link #getSignalNotificationRuleWithHttpInfo}. * - * @param suppressionId The ID of the suppression rule (required) - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<GetSuppressionVersionHistoryResponse>> + * @param id ID of the notification rule. (required) + * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> */ - public CompletableFuture> - getSuppressionVersionHistoryWithHttpInfoAsync( - String suppressionId, GetSuppressionVersionHistoryOptionalParameters parameters) { + public CompletableFuture> + getSignalNotificationRuleWithHttpInfoAsync(String id) { Object localVarPostBody = null; - // verify the required parameter 'suppressionId' is set - if (suppressionId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'suppressionId' when calling" - + " getSuppressionVersionHistory")); + 400, "Missing the required parameter 'id' when calling getSignalNotificationRule")); return result; } - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history" - .replaceAll( - "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); + "/api/v2/security/signals/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getSuppressionVersionHistory", + "v2.SecurityMonitoringApi.getSignalNotificationRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -14511,33 +14196,30 @@ public ApiResponse getSuppressionVersionHi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get details of a vulnerability notification rule. + * Get the list of signal-based notification rules. * - *

See {@link #getVulnerabilityNotificationRuleWithHttpInfo}. + *

See {@link #getSignalNotificationRulesWithHttpInfo}. * - * @param id ID of the notification rule. (required) - * @return NotificationRuleResponse + * @return NotificationRulesListResponse * @throws ApiException if fails to make API call */ - public NotificationRuleResponse getVulnerabilityNotificationRule(String id) throws ApiException { - return getVulnerabilityNotificationRuleWithHttpInfo(id).getData(); + public NotificationRulesListResponse getSignalNotificationRules() throws ApiException { + return getSignalNotificationRulesWithHttpInfo().getData(); } /** - * Get details of a vulnerability notification rule. + * Get the list of signal-based notification rules. * - *

See {@link #getVulnerabilityNotificationRuleWithHttpInfoAsync}. + *

See {@link #getSignalNotificationRulesWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) - * @return CompletableFuture<NotificationRuleResponse> + * @return CompletableFuture<NotificationRulesListResponse> */ - public CompletableFuture getVulnerabilityNotificationRuleAsync( - String id) { - return getVulnerabilityNotificationRuleWithHttpInfoAsync(id) + public CompletableFuture getSignalNotificationRulesAsync() { + return getSignalNotificationRulesWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -14545,41 +14227,30 @@ public CompletableFuture getVulnerabilityNotificationR } /** - * Get the details of a notification rule for security vulnerabilities. + * Returns the list of notification rules for security signals. * - * @param id ID of the notification rule. (required) - * @return ApiResponse<NotificationRuleResponse> + * @return ApiResponse<NotificationRulesListResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * * - * * *
Response details
Status Code Description Response Headers
200 Notification rule details. -
400 Bad Request -
200 The list of notification rules. -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getVulnerabilityNotificationRuleWithHttpInfo( - String id) throws ApiException { + public ApiResponse getSignalNotificationRulesWithHttpInfo() + throws ApiException { Object localVarPostBody = null; - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - 400, "Missing the required parameter 'id' when calling getVulnerabilityNotificationRule"); - } // 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/signals/notification_rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.getSignalNotificationRules", localVarPath, new ArrayList(), localVarHeaderParams, @@ -14594,34 +14265,21 @@ public ApiResponse getVulnerabilityNotificationRuleWit localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get details of a vulnerability notification rule. + * Get the list of signal-based notification rules. * - *

See {@link #getVulnerabilityNotificationRuleWithHttpInfo}. + *

See {@link #getSignalNotificationRulesWithHttpInfo}. * - * @param id ID of the notification rule. (required) - * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> + * @return CompletableFuture<ApiResponse<NotificationRulesListResponse>> */ - public CompletableFuture> - getVulnerabilityNotificationRuleWithHttpInfoAsync(String id) { + public CompletableFuture> + getSignalNotificationRulesWithHttpInfoAsync() { Object localVarPostBody = null; - - // verify the required parameter 'id' is set - if (id == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'id' when calling getVulnerabilityNotificationRule")); - 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/signals/notification_rules"; Map localVarHeaderParams = new HashMap(); @@ -14629,7 +14287,7 @@ public ApiResponse getVulnerabilityNotificationRuleWit try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.getSignalNotificationRules", localVarPath, new ArrayList(), localVarHeaderParams, @@ -14637,7 +14295,8 @@ public ApiResponse getVulnerabilityNotificationRuleWit new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -14649,30 +14308,81 @@ public ApiResponse getVulnerabilityNotificationRuleWit localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to getSingleEntityContext. */ + public static class GetSingleEntityContextOptionalParameters { + private String from; + private String to; + private String asOf; + + /** + * Set from. + * + * @param from The start of the time range to query, as an RFC3339 timestamp or a relative time + * (for example, now-7d). Defaults to now-7d. Ignored when + * as_of is set. (optional, default to "now-7d") + * @return GetSingleEntityContextOptionalParameters + */ + public GetSingleEntityContextOptionalParameters from(String from) { + this.from = from; + return this; + } + + /** + * Set to. + * + * @param to The end of the time range to query, as an RFC3339 timestamp or a relative time (for + * example, now). Defaults to now. Ignored when as_of + * is set. (optional, default to "now") + * @return GetSingleEntityContextOptionalParameters + */ + public GetSingleEntityContextOptionalParameters to(String to) { + this.to = to; + return this; + } + + /** + * Set asOf. + * + * @param asOf A point in time at which to query the entity revisions, as an RFC3339 timestamp, + * a Unix timestamp (in seconds), or a relative time (for example, now-1d). + * When set, from and to are ignored. Cannot be combined with + * custom from / to values. (optional) + * @return GetSingleEntityContextOptionalParameters + */ + public GetSingleEntityContextOptionalParameters asOf(String asOf) { + this.asOf = asOf; + return this; + } } /** - * Get the list of vulnerability notification rules. + * Get a single entity context. * - *

See {@link #getVulnerabilityNotificationRulesWithHttpInfo}. + *

See {@link #getSingleEntityContextWithHttpInfo}. * - * @return NotificationRulesListResponse + * @param id The unique identifier of the entity to retrieve. (required) + * @return SingleEntityContextResponse * @throws ApiException if fails to make API call */ - public NotificationRulesListResponse getVulnerabilityNotificationRules() throws ApiException { - return getVulnerabilityNotificationRulesWithHttpInfo().getData(); + public SingleEntityContextResponse getSingleEntityContext(String id) throws ApiException { + return getSingleEntityContextWithHttpInfo(id, new GetSingleEntityContextOptionalParameters()) + .getData(); } /** - * Get the list of vulnerability notification rules. + * Get a single entity context. * - *

See {@link #getVulnerabilityNotificationRulesWithHttpInfoAsync}. + *

See {@link #getSingleEntityContextWithHttpInfoAsync}. * - * @return CompletableFuture<NotificationRulesListResponse> + * @param id The unique identifier of the entity to retrieve. (required) + * @return CompletableFuture<SingleEntityContextResponse> */ - public CompletableFuture getVulnerabilityNotificationRulesAsync() { - return getVulnerabilityNotificationRulesWithHttpInfoAsync() + public CompletableFuture getSingleEntityContextAsync(String id) { + return getSingleEntityContextWithHttpInfoAsync( + id, new GetSingleEntityContextOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -14680,36 +14390,99 @@ public CompletableFuture getVulnerabilityNotifica } /** - * Returns the list of notification rules for security vulnerabilities. + * Get a single entity context. * - * @return ApiResponse<NotificationRulesListResponse> + *

See {@link #getSingleEntityContextWithHttpInfo}. + * + * @param id The unique identifier of the entity to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return SingleEntityContextResponse + * @throws ApiException if fails to make API call + */ + public SingleEntityContextResponse getSingleEntityContext( + String id, GetSingleEntityContextOptionalParameters parameters) throws ApiException { + return getSingleEntityContextWithHttpInfo(id, parameters).getData(); + } + + /** + * Get a single entity context. + * + *

See {@link #getSingleEntityContextWithHttpInfoAsync}. + * + * @param id The unique identifier of the entity to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SingleEntityContextResponse> + */ + public CompletableFuture getSingleEntityContextAsync( + String id, GetSingleEntityContextOptionalParameters parameters) { + return getSingleEntityContextWithHttpInfoAsync(id, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a single entity from the Cloud SIEM entity context store by its identifier, returning the + * historical revisions of the entity in the requested time range. The endpoint can either return + * revisions across an interval (from / to) or the snapshot of the + * entity at a single point in time (as_of); the two modes are mutually exclusive. + * + * @param id The unique identifier of the entity to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<SingleEntityContextResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * + * + * * *
Response details
Status Code Description Response Headers
200 The list of notification rules. -
403 Forbidden -
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse getVulnerabilityNotificationRulesWithHttpInfo() - throws ApiException { + public ApiResponse getSingleEntityContextWithHttpInfo( + String id, GetSingleEntityContextOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getSingleEntityContext"; + 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 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getSingleEntityContext"); + } + String from = parameters.from; + String to = parameters.to; + String asOf = parameters.asOf; // create path and map variables - String localVarPath = "/api/v2/security/vulnerabilities/notification_rules"; + String localVarPath = + "/api/v2/security_monitoring/entity_context/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); + Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getVulnerabilityNotificationRules", + "v2.SecurityMonitoringApi.getSingleEntityContext", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", builder, @@ -14718,37 +14491,71 @@ public ApiResponse getVulnerabilityNotificationRu localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get the list of vulnerability notification rules. + * Get a single entity context. * - *

See {@link #getVulnerabilityNotificationRulesWithHttpInfo}. + *

See {@link #getSingleEntityContextWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<NotificationRulesListResponse>> + * @param id The unique identifier of the entity to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SingleEntityContextResponse>> */ - public CompletableFuture> - getVulnerabilityNotificationRulesWithHttpInfoAsync() { + public CompletableFuture> + getSingleEntityContextWithHttpInfoAsync( + String id, GetSingleEntityContextOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getSingleEntityContext"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling getSingleEntityContext")); + return result; + } + String from = parameters.from; + String to = parameters.to; + String asOf = parameters.asOf; // create path and map variables - String localVarPath = "/api/v2/security/vulnerabilities/notification_rules"; + String localVarPath = + "/api/v2/security_monitoring/entity_context/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "from", from)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "to", to)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "as_of", asOf)); + Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.getVulnerabilityNotificationRules", + "v2.SecurityMonitoringApi.getSingleEntityContext", localVarPath, - new ArrayList(), + localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -14761,168 +14568,34 @@ public ApiResponse getVulnerabilityNotificationRu localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listAssetsSBOMs. */ - public static class ListAssetsSBOMsOptionalParameters { - private String pageToken; - private Long pageNumber; - private AssetType filterAssetType; - private String filterAssetName; - private String filterPackageName; - private String filterPackageVersion; - private String filterLicenseName; - private SBOMComponentLicenseType filterLicenseType; - - /** - * Set pageToken. - * - * @param pageToken Its value must come from the links section of the response of - * the first request. Do not manually edit it. (optional) - * @return ListAssetsSBOMsOptionalParameters - */ - public ListAssetsSBOMsOptionalParameters pageToken(String pageToken) { - this.pageToken = pageToken; - return this; - } - - /** - * Set pageNumber. - * - * @param pageNumber The page number to be retrieved. It should be equal to or greater than 1. - * (optional) - * @return ListAssetsSBOMsOptionalParameters - */ - public ListAssetsSBOMsOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; - return this; - } - - /** - * Set filterAssetType. - * - * @param filterAssetType The type of the assets for the SBOM request. (optional) - * @return ListAssetsSBOMsOptionalParameters - */ - public ListAssetsSBOMsOptionalParameters filterAssetType(AssetType filterAssetType) { - this.filterAssetType = filterAssetType; - return this; - } - - /** - * Set filterAssetName. - * - * @param filterAssetName The name of the asset for the SBOM request. (optional) - * @return ListAssetsSBOMsOptionalParameters - */ - public ListAssetsSBOMsOptionalParameters filterAssetName(String filterAssetName) { - this.filterAssetName = filterAssetName; - return this; - } - - /** - * Set filterPackageName. - * - * @param filterPackageName The name of the component that is a dependency of an asset. - * (optional) - * @return ListAssetsSBOMsOptionalParameters - */ - public ListAssetsSBOMsOptionalParameters filterPackageName(String filterPackageName) { - this.filterPackageName = filterPackageName; - return this; - } - - /** - * Set filterPackageVersion. - * - * @param filterPackageVersion The version of the component that is a dependency of an asset. - * (optional) - * @return ListAssetsSBOMsOptionalParameters - */ - public ListAssetsSBOMsOptionalParameters filterPackageVersion(String filterPackageVersion) { - this.filterPackageVersion = filterPackageVersion; - return this; - } - - /** - * Set filterLicenseName. - * - * @param filterLicenseName The software license name of the component that is a dependency of - * an asset. (optional) - * @return ListAssetsSBOMsOptionalParameters - */ - public ListAssetsSBOMsOptionalParameters filterLicenseName(String filterLicenseName) { - this.filterLicenseName = filterLicenseName; - return this; - } - - /** - * Set filterLicenseType. - * - * @param filterLicenseType The software license type of the component that is a dependency of - * an asset. (optional) - * @return ListAssetsSBOMsOptionalParameters - */ - public ListAssetsSBOMsOptionalParameters filterLicenseType( - SBOMComponentLicenseType filterLicenseType) { - this.filterLicenseType = filterLicenseType; - return this; - } - } - - /** - * List assets SBOMs. - * - *

See {@link #listAssetsSBOMsWithHttpInfo}. - * - * @return ListAssetsSBOMsResponse - * @throws ApiException if fails to make API call - */ - public ListAssetsSBOMsResponse listAssetsSBOMs() throws ApiException { - return listAssetsSBOMsWithHttpInfo(new ListAssetsSBOMsOptionalParameters()).getData(); - } + /** + * Get default rulesets for a language. + * + *

See {@link #getStaticAnalysisDefaultRulesetsWithHttpInfo}. + * + * @param language The programming language for which to retrieve the default rulesets. (required) + * @return DefaultRulesetsPerLanguageResponse + * @throws ApiException if fails to make API call + */ + public DefaultRulesetsPerLanguageResponse getStaticAnalysisDefaultRulesets(String language) + throws ApiException { + return getStaticAnalysisDefaultRulesetsWithHttpInfo(language).getData(); + } /** - * List assets SBOMs. - * - *

See {@link #listAssetsSBOMsWithHttpInfoAsync}. - * - * @return CompletableFuture<ListAssetsSBOMsResponse> - */ - public CompletableFuture listAssetsSBOMsAsync() { - return listAssetsSBOMsWithHttpInfoAsync(new ListAssetsSBOMsOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * List assets SBOMs. - * - *

See {@link #listAssetsSBOMsWithHttpInfo}. - * - * @param parameters Optional parameters for the request. - * @return ListAssetsSBOMsResponse - * @throws ApiException if fails to make API call - */ - public ListAssetsSBOMsResponse listAssetsSBOMs(ListAssetsSBOMsOptionalParameters parameters) - throws ApiException { - return listAssetsSBOMsWithHttpInfo(parameters).getData(); - } - - /** - * List assets SBOMs. + * Get default rulesets for a language. * - *

See {@link #listAssetsSBOMsWithHttpInfoAsync}. + *

See {@link #getStaticAnalysisDefaultRulesetsWithHttpInfoAsync}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListAssetsSBOMsResponse> + * @param language The programming language for which to retrieve the default rulesets. (required) + * @return CompletableFuture<DefaultRulesetsPerLanguageResponse> */ - public CompletableFuture listAssetsSBOMsAsync( - ListAssetsSBOMsOptionalParameters parameters) { - return listAssetsSBOMsWithHttpInfoAsync(parameters) + public CompletableFuture + getStaticAnalysisDefaultRulesetsAsync(String language) { + return getStaticAnalysisDefaultRulesetsWithHttpInfoAsync(language) .thenApply( response -> { return response.getData(); @@ -14930,78 +14603,54 @@ public CompletableFuture listAssetsSBOMsAsync( } /** - * Get a list of assets SBOMs for an organization. - * - *

Pagination

- * - *

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

Filtering

- * - *

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

Metadata

- * - *

Please review the Metadata section for the "List Vulnerabilities" - * endpoint. + * Get the default SAST ruleset names for a given programming language. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<ListAssetsSBOMsResponse> + * @param language The programming language for which to retrieve the default rulesets. (required) + * @return ApiResponse<DefaultRulesetsPerLanguageResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * - * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: asset not found -
400 Bad Request -
429 Too many requests -
*/ - public ApiResponse listAssetsSBOMsWithHttpInfo( - ListAssetsSBOMsOptionalParameters parameters) throws ApiException { + public ApiResponse + getStaticAnalysisDefaultRulesetsWithHttpInfo(String language) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getStaticAnalysisDefaultRulesets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = null; - String pageToken = parameters.pageToken; - Long pageNumber = parameters.pageNumber; - AssetType filterAssetType = parameters.filterAssetType; - String filterAssetName = parameters.filterAssetName; - String filterPackageName = parameters.filterPackageName; - String filterPackageVersion = parameters.filterPackageVersion; - String filterLicenseName = parameters.filterLicenseName; - SBOMComponentLicenseType filterLicenseType = parameters.filterLicenseType; + + // verify the required parameter 'language' is set + if (language == null) { + throw new ApiException( + 400, + "Missing the required parameter 'language' when calling" + + " getStaticAnalysisDefaultRulesets"); + } // create path and map variables - String localVarPath = "/api/v2/security/sboms"; + String localVarPath = + "/api/v2/static-analysis/default-rulesets/{language}" + .replaceAll("\\{" + "language" + "\\}", apiClient.escapeString(language.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset_type]", filterAssetType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[package_name]", filterPackageName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[package_version]", filterPackageVersion)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[license_name]", filterLicenseName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[license_type]", filterLicenseType)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listAssetsSBOMs", + "v2.SecurityMonitoringApi.getStaticAnalysisDefaultRulesets", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", builder, @@ -15010,62 +14659,64 @@ public ApiResponse listAssetsSBOMsWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List assets SBOMs. + * Get default rulesets for a language. * - *

See {@link #listAssetsSBOMsWithHttpInfo}. + *

See {@link #getStaticAnalysisDefaultRulesetsWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ListAssetsSBOMsResponse>> + * @param language The programming language for which to retrieve the default rulesets. (required) + * @return CompletableFuture<ApiResponse<DefaultRulesetsPerLanguageResponse>> */ - public CompletableFuture> listAssetsSBOMsWithHttpInfoAsync( - ListAssetsSBOMsOptionalParameters parameters) { + public CompletableFuture> + getStaticAnalysisDefaultRulesetsWithHttpInfoAsync(String language) { + // Check if unstable operation is enabled + String operationId = "getStaticAnalysisDefaultRulesets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - String pageToken = parameters.pageToken; - Long pageNumber = parameters.pageNumber; - AssetType filterAssetType = parameters.filterAssetType; - String filterAssetName = parameters.filterAssetName; - String filterPackageName = parameters.filterPackageName; - String filterPackageVersion = parameters.filterPackageVersion; - String filterLicenseName = parameters.filterLicenseName; - SBOMComponentLicenseType filterLicenseType = parameters.filterLicenseType; - // create path and map variables - String localVarPath = "/api/v2/security/sboms"; - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset_type]", filterAssetType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[package_name]", filterPackageName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[package_version]", filterPackageVersion)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[license_name]", filterLicenseName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[license_type]", filterLicenseType)); + // verify the required parameter 'language' is set + if (language == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'language' when calling" + + " getStaticAnalysisDefaultRulesets")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/static-analysis/default-rulesets/{language}" + .replaceAll("\\{" + "language" + "\\}", apiClient.escapeString(language.toString())); + + Map localVarHeaderParams = new HashMap(); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listAssetsSBOMs", + "v2.SecurityMonitoringApi.getStaticAnalysisDefaultRulesets", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -15077,224 +14728,223 @@ public CompletableFuture> listAssetsSBOMsWi localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listFindings. */ - public static class ListFindingsOptionalParameters { - private Long pageLimit; - private Long snapshotTimestamp; - private String pageCursor; - private String filterTags; - private String filterEvaluationChangedAt; - private Boolean filterMuted; - private String filterRuleId; - private String filterRuleName; - private String filterResourceType; - private String filterResourceId; - private String filterDiscoveryTimestamp; - private FindingEvaluation filterEvaluation; - private FindingStatus filterStatus; - private List filterVulnerabilityType; - private Boolean detailedFindings; + /** + * Get node types for a language. + * + *

See {@link #getStaticAnalysisNodeTypesWithHttpInfo}. + * + * @param language The programming language for which to retrieve node type definitions. + * (required) + * @return NodeTypesResponse + * @throws ApiException if fails to make API call + */ + public NodeTypesResponse getStaticAnalysisNodeTypes(String language) throws ApiException { + return getStaticAnalysisNodeTypesWithHttpInfo(language).getData(); + } - /** - * Set pageLimit. - * - * @param pageLimit Limit the number of findings returned. Must be <= 1000. (optional, - * default to 100) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters pageLimit(Long pageLimit) { - this.pageLimit = pageLimit; - return this; + /** + * Get node types for a language. + * + *

See {@link #getStaticAnalysisNodeTypesWithHttpInfoAsync}. + * + * @param language The programming language for which to retrieve node type definitions. + * (required) + * @return CompletableFuture<NodeTypesResponse> + */ + public CompletableFuture getStaticAnalysisNodeTypesAsync(String language) { + return getStaticAnalysisNodeTypesWithHttpInfoAsync(language) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve tree-sitter node type definitions for a given programming language. + * + * @param language The programming language for which to retrieve node type definitions. + * (required) + * @return ApiResponse<NodeTypesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
429 Too many requests -
+ */ + public ApiResponse getStaticAnalysisNodeTypesWithHttpInfo(String language) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getStaticAnalysisNodeTypes"; + 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; - /** - * Set snapshotTimestamp. - * - * @param snapshotTimestamp Return findings for a given snapshot of time (Unix ms). (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters snapshotTimestamp(Long snapshotTimestamp) { - this.snapshotTimestamp = snapshotTimestamp; - return this; + // verify the required parameter 'language' is set + if (language == null) { + throw new ApiException( + 400, "Missing the required parameter 'language' when calling getStaticAnalysisNodeTypes"); } + // create path and map variables + String localVarPath = + "/api/v2/static-analysis/static-analysis-server/node-types/{language}" + .replaceAll("\\{" + "language" + "\\}", apiClient.escapeString(language.toString())); - /** - * Set pageCursor. - * - * @param pageCursor Return the next page of findings pointed to by the cursor. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters pageCursor(String pageCursor) { - this.pageCursor = pageCursor; - return this; + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getStaticAnalysisNodeTypes", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get node types for a language. + * + *

See {@link #getStaticAnalysisNodeTypesWithHttpInfo}. + * + * @param language The programming language for which to retrieve node type definitions. + * (required) + * @return CompletableFuture<ApiResponse<NodeTypesResponse>> + */ + public CompletableFuture> + getStaticAnalysisNodeTypesWithHttpInfoAsync(String language) { + // Check if unstable operation is enabled + String operationId = "getStaticAnalysisNodeTypes"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; } + Object localVarPostBody = null; + + // verify the required parameter 'language' is set + if (language == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'language' when calling getStaticAnalysisNodeTypes")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/static-analysis/static-analysis-server/node-types/{language}" + .replaceAll("\\{" + "language" + "\\}", apiClient.escapeString(language.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getStaticAnalysisNodeTypes", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to getStaticAnalysisRuleset. */ + public static class GetStaticAnalysisRulesetOptionalParameters { + private Boolean includeTests; + private Boolean includeTestingRules; /** - * Set filterTags. + * Set includeTests. * - * @param filterTags Return findings that have these associated tags (repeatable). (optional) - * @return ListFindingsOptionalParameters + * @param includeTests When true, test cases for each rule are included in the response. + * (optional) + * @return GetStaticAnalysisRulesetOptionalParameters */ - public ListFindingsOptionalParameters filterTags(String filterTags) { - this.filterTags = filterTags; + public GetStaticAnalysisRulesetOptionalParameters includeTests(Boolean includeTests) { + this.includeTests = includeTests; return this; } /** - * Set filterEvaluationChangedAt. + * Set includeTestingRules. * - * @param filterEvaluationChangedAt Return findings that have changed from pass to fail or vice - * versa on a specified date (Unix ms) or date range (using comparison operators). - * (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterEvaluationChangedAt( - String filterEvaluationChangedAt) { - this.filterEvaluationChangedAt = filterEvaluationChangedAt; - return this; - } - - /** - * Set filterMuted. - * - * @param filterMuted Set to true to return findings that are muted. Set to - * false to return unmuted findings. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterMuted(Boolean filterMuted) { - this.filterMuted = filterMuted; - return this; - } - - /** - * Set filterRuleId. - * - * @param filterRuleId Return findings for the specified rule ID. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterRuleId(String filterRuleId) { - this.filterRuleId = filterRuleId; - return this; - } - - /** - * Set filterRuleName. - * - * @param filterRuleName Return findings for the specified rule. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterRuleName(String filterRuleName) { - this.filterRuleName = filterRuleName; - return this; - } - - /** - * Set filterResourceType. - * - * @param filterResourceType Return only findings for the specified resource type. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterResourceType(String filterResourceType) { - this.filterResourceType = filterResourceType; - return this; - } - - /** - * Set filterResourceId. - * - * @param filterResourceId Return only findings for the specified resource id. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterResourceId(String filterResourceId) { - this.filterResourceId = filterResourceId; - return this; - } - - /** - * Set filterDiscoveryTimestamp. - * - * @param filterDiscoveryTimestamp Return findings that were found on a specified date (Unix ms) - * or date range (using comparison operators). (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterDiscoveryTimestamp( - String filterDiscoveryTimestamp) { - this.filterDiscoveryTimestamp = filterDiscoveryTimestamp; - return this; - } - - /** - * Set filterEvaluation. - * - * @param filterEvaluation Return only pass or fail findings. - * (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterEvaluation(FindingEvaluation filterEvaluation) { - this.filterEvaluation = filterEvaluation; - return this; - } - - /** - * Set filterStatus. - * - * @param filterStatus Return only findings with the specified status. (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterStatus(FindingStatus filterStatus) { - this.filterStatus = filterStatus; - return this; - } - - /** - * Set filterVulnerabilityType. - * - * @param filterVulnerabilityType Return findings that match the selected vulnerability types - * (repeatable). (optional) - * @return ListFindingsOptionalParameters - */ - public ListFindingsOptionalParameters filterVulnerabilityType( - List filterVulnerabilityType) { - this.filterVulnerabilityType = filterVulnerabilityType; - return this; - } - - /** - * Set detailedFindings. - * - * @param detailedFindings Return additional fields for some findings. (optional) - * @return ListFindingsOptionalParameters + * @param includeTestingRules When true, rules that are in testing mode are included in the + * response. (optional) + * @return GetStaticAnalysisRulesetOptionalParameters */ - public ListFindingsOptionalParameters detailedFindings(Boolean detailedFindings) { - this.detailedFindings = detailedFindings; + public GetStaticAnalysisRulesetOptionalParameters includeTestingRules( + Boolean includeTestingRules) { + this.includeTestingRules = includeTestingRules; return this; } } /** - * List findings. + * Get a SAST ruleset. * - *

See {@link #listFindingsWithHttpInfo}. + *

See {@link #getStaticAnalysisRulesetWithHttpInfo}. * - * @return ListFindingsResponse + * @param rulesetName The name of the ruleset to retrieve. (required) + * @return SastRulesetResponse * @throws ApiException if fails to make API call */ - public ListFindingsResponse listFindings() throws ApiException { - return listFindingsWithHttpInfo(new ListFindingsOptionalParameters()).getData(); + public SastRulesetResponse getStaticAnalysisRuleset(String rulesetName) throws ApiException { + return getStaticAnalysisRulesetWithHttpInfo( + rulesetName, new GetStaticAnalysisRulesetOptionalParameters()) + .getData(); } /** - * List findings. + * Get a SAST ruleset. * - *

See {@link #listFindingsWithHttpInfoAsync}. + *

See {@link #getStaticAnalysisRulesetWithHttpInfoAsync}. * - * @return CompletableFuture<ListFindingsResponse> + * @param rulesetName The name of the ruleset to retrieve. (required) + * @return CompletableFuture<SastRulesetResponse> */ - public CompletableFuture listFindingsAsync() { - return listFindingsWithHttpInfoAsync(new ListFindingsOptionalParameters()) + public CompletableFuture getStaticAnalysisRulesetAsync(String rulesetName) { + return getStaticAnalysisRulesetWithHttpInfoAsync( + rulesetName, new GetStaticAnalysisRulesetOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -15302,30 +14952,33 @@ public CompletableFuture listFindingsAsync() { } /** - * List findings. + * Get a SAST ruleset. * - *

See {@link #listFindingsWithHttpInfo}. + *

See {@link #getStaticAnalysisRulesetWithHttpInfo}. * + * @param rulesetName The name of the ruleset to retrieve. (required) * @param parameters Optional parameters for the request. - * @return ListFindingsResponse + * @return SastRulesetResponse * @throws ApiException if fails to make API call */ - public ListFindingsResponse listFindings(ListFindingsOptionalParameters parameters) + public SastRulesetResponse getStaticAnalysisRuleset( + String rulesetName, GetStaticAnalysisRulesetOptionalParameters parameters) throws ApiException { - return listFindingsWithHttpInfo(parameters).getData(); + return getStaticAnalysisRulesetWithHttpInfo(rulesetName, parameters).getData(); } /** - * List findings. + * Get a SAST ruleset. * - *

See {@link #listFindingsWithHttpInfoAsync}. + *

See {@link #getStaticAnalysisRulesetWithHttpInfoAsync}. * + * @param rulesetName The name of the ruleset to retrieve. (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListFindingsResponse> + * @return CompletableFuture<SastRulesetResponse> */ - public CompletableFuture listFindingsAsync( - ListFindingsOptionalParameters parameters) { - return listFindingsWithHttpInfoAsync(parameters) + public CompletableFuture getStaticAnalysisRulesetAsync( + String rulesetName, GetStaticAnalysisRulesetOptionalParameters parameters) { + return getStaticAnalysisRulesetWithHttpInfoAsync(rulesetName, parameters) .thenApply( response -> { return response.getData(); @@ -15333,203 +14986,228 @@ public CompletableFuture listFindingsAsync( } /** - * List findings. - * - *

See {@link #listFindingsWithHttpInfo}. + * Get a SAST ruleset by name, including all its rules. * - * @return PaginationIterable<Finding> + * @param rulesetName The name of the ruleset to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<SastRulesetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
*/ - public PaginationIterable listFindingsWithPagination() { - ListFindingsOptionalParameters parameters = new ListFindingsOptionalParameters(); - return listFindingsWithPagination(parameters); + public ApiResponse getStaticAnalysisRulesetWithHttpInfo( + String rulesetName, GetStaticAnalysisRulesetOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getStaticAnalysisRuleset"; + 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 'rulesetName' is set + if (rulesetName == null) { + throw new ApiException( + 400, + "Missing the required parameter 'rulesetName' when calling getStaticAnalysisRuleset"); + } + Boolean includeTests = parameters.includeTests; + Boolean includeTestingRules = parameters.includeTestingRules; + // create path and map variables + String localVarPath = + "/api/v2/static-analysis/rulesets/{ruleset_name}" + .replaceAll( + "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_tests", includeTests)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "include_testing_rules", includeTestingRules)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getStaticAnalysisRuleset", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * List findings. + * Get a SAST ruleset. * - *

See {@link #listFindingsWithHttpInfo}. + *

See {@link #getStaticAnalysisRulesetWithHttpInfo}. * - * @return ListFindingsResponse - */ - public PaginationIterable listFindingsWithPagination( - ListFindingsOptionalParameters parameters) { - String resultsPath = "getData"; - String valueGetterPath = "getMeta.getPage.getCursor"; - String valueSetterPath = "pageCursor"; - Boolean valueSetterParamOptional = true; - Long limit; - - if (parameters.pageLimit == null) { - limit = 100l; - parameters.pageLimit(limit); + * @param rulesetName The name of the ruleset to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SastRulesetResponse>> + */ + public CompletableFuture> + getStaticAnalysisRulesetWithHttpInfoAsync( + String rulesetName, GetStaticAnalysisRulesetOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "getStaticAnalysisRuleset"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - limit = parameters.pageLimit; + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; } + Object localVarPostBody = null; - LinkedHashMap args = new LinkedHashMap(); - args.put("optionalParams", parameters); + // verify the required parameter 'rulesetName' is set + if (rulesetName == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'rulesetName' when calling" + + " getStaticAnalysisRuleset")); + return result; + } + Boolean includeTests = parameters.includeTests; + Boolean includeTestingRules = parameters.includeTestingRules; + // create path and map variables + String localVarPath = + "/api/v2/static-analysis/rulesets/{ruleset_name}" + .replaceAll( + "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString())); - PaginationIterable iterator = - new PaginationIterable( - this, - "listFindings", - resultsPath, - valueGetterPath, - valueSetterPath, - valueSetterParamOptional, - true, - true, - limit, - args, - 0); + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); - return iterator; + localVarQueryParams.addAll(apiClient.parameterToPairs("", "include_tests", includeTests)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "include_testing_rules", includeTestingRules)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getStaticAnalysisRuleset", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * Get a list of findings. These include both misconfigurations and identity risks. - * - *

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

Filtering

- * - *

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

- * - *

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

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

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

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

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

Additional extension fields

- * - *

Additional extension fields are available for some findings. - * - *

The data is available when you include the query parameter ?detailed_findings=true - * in the request. - * - *

The following fields are available for findings: - external_id: The resource - * external ID related to the finding. - description: The description and remediation - * steps for the finding. - datadog_link: The Datadog relative link for the finding. - * - ip_addresses: The list of private IP addresses for the resource related to the - * finding. + * Get tree-sitter WASM file. * - *

Response

+ *

See {@link #getStaticAnalysisTreeSitterWasmWithHttpInfo}. * - *

The response includes an array of finding objects, pagination metadata, and a count of items - * that match the query. + * @param file The name of the WASM file to download. (required) + * @return File + * @throws ApiException if fails to make API call + */ + public File getStaticAnalysisTreeSitterWasm(String file) throws ApiException { + return getStaticAnalysisTreeSitterWasmWithHttpInfo(file).getData(); + } + + /** + * Get tree-sitter WASM file. * - *

Each finding object contains the following: + *

See {@link #getStaticAnalysisTreeSitterWasmWithHttpInfoAsync}. * - *

+ * @param file The name of the WASM file to download. (required) + * @return CompletableFuture<File> + */ + public CompletableFuture getStaticAnalysisTreeSitterWasmAsync(String file) { + return getStaticAnalysisTreeSitterWasmWithHttpInfoAsync(file) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Download the WebAssembly binary for a tree-sitter grammar by file name. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<ListFindingsResponse> + * @param file The name of the WASM file to download. (required) + * @return ApiResponse<File> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * - * - * + * + * + * + * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not Found: The requested finding cannot be found. -
429 Too many requests: The rate limit set by the API has been exceeded. -
200 BLOB with the content of the WASM file -
400 Bad Request -
401 Unauthorized -
429 Too many requests -
*/ - public ApiResponse listFindingsWithHttpInfo( - ListFindingsOptionalParameters parameters) throws ApiException { + public ApiResponse getStaticAnalysisTreeSitterWasmWithHttpInfo(String file) + throws ApiException { // Check if unstable operation is enabled - String operationId = "listFindings"; + String operationId = "getStaticAnalysisTreeSitterWasm"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } Object localVarPostBody = null; - Long pageLimit = parameters.pageLimit; - Long snapshotTimestamp = parameters.snapshotTimestamp; - String pageCursor = parameters.pageCursor; - String filterTags = parameters.filterTags; - String filterEvaluationChangedAt = parameters.filterEvaluationChangedAt; - Boolean filterMuted = parameters.filterMuted; - String filterRuleId = parameters.filterRuleId; - String filterRuleName = parameters.filterRuleName; - String filterResourceType = parameters.filterResourceType; - String filterResourceId = parameters.filterResourceId; - String filterDiscoveryTimestamp = parameters.filterDiscoveryTimestamp; - FindingEvaluation filterEvaluation = parameters.filterEvaluation; - FindingStatus filterStatus = parameters.filterStatus; - List filterVulnerabilityType = parameters.filterVulnerabilityType; - Boolean detailedFindings = parameters.detailedFindings; + + // verify the required parameter 'file' is set + if (file == null) { + throw new ApiException( + 400, + "Missing the required parameter 'file' when calling getStaticAnalysisTreeSitterWasm"); + } // create path and map variables - String localVarPath = "/api/v2/posture_management/findings"; + String localVarPath = + "/api/v2/static-analysis/static-analysis-server/tree-sitter-wasm/{file}" + .replaceAll("\\{" + "file" + "\\}", apiClient.escapeString(file.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "snapshot_timestamp", snapshotTimestamp)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[evaluation_changed_at]", filterEvaluationChangedAt)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[muted]", filterMuted)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_id]", filterRuleId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[rule_name]", filterRuleName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[resource_type]", filterResourceType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[@resource_id]", filterResourceId)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[discovery_timestamp]", filterDiscoveryTimestamp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[evaluation]", filterEvaluation)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("multi", "filter[vulnerability_type]", filterVulnerabilityType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "detailed_findings", detailedFindings)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listFindings", + "v2.SecurityMonitoringApi.getStaticAnalysisTreeSitterWasm", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), - new String[] {"application/json"}, + new String[] {"application/octet-stream", "application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( "GET", @@ -15539,88 +15217,61 @@ public ApiResponse listFindingsWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List findings. + * Get tree-sitter WASM file. * - *

See {@link #listFindingsWithHttpInfo}. + *

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

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

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

See {@link #listHistoricalJobsWithHttpInfo}. + *

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

See {@link #listHistoricalJobsWithHttpInfoAsync}. + *

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

See {@link #listHistoricalJobsWithHttpInfo}. + *

See {@link #getSuggestedActionsMatchingSignalWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ListHistoricalJobsResponse>> + * @param signalId The ID of the signal. (required) + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringSignalSuggestedActionsResponse>> */ - public CompletableFuture> - listHistoricalJobsWithHttpInfoAsync(ListHistoricalJobsOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "listHistoricalJobs"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } + public CompletableFuture> + getSuggestedActionsMatchingSignalWithHttpInfoAsync(String signalId) { Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - String sort = parameters.sort; - String filterQuery = parameters.filterQuery; + + // verify the required parameter 'signalId' is set + if (signalId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'signalId' when calling" + + " getSuggestedActionsMatchingSignal")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/siem-historical-detections/jobs"; + String localVarPath = + "/api/v2/security_monitoring/signals/{signal_id}/suggested_actions" + .replaceAll("\\{" + "signal_id" + "\\}", apiClient.escapeString(signalId.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listHistoricalJobs", + "v2.SecurityMonitoringApi.getSuggestedActionsMatchingSignal", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -15867,168 +15427,34 @@ public ApiResponse listHistoricalJobsWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to listIndicatorsOfCompromise. */ - public static class ListIndicatorsOfCompromiseOptionalParameters { - private Integer limit; - private Integer offset; - private String query; - private String sortColumn; - private String sortOrder; - private Boolean ocsf; - private String workedBy; - private IoCTriageState triageState; - - /** - * Set limit. - * - * @param limit Number of results per page. (optional, default to 50) - * @return ListIndicatorsOfCompromiseOptionalParameters - */ - public ListIndicatorsOfCompromiseOptionalParameters limit(Integer limit) { - this.limit = limit; - return this; - } - - /** - * Set offset. - * - * @param offset Pagination offset. (optional, default to 0) - * @return ListIndicatorsOfCompromiseOptionalParameters - */ - public ListIndicatorsOfCompromiseOptionalParameters offset(Integer offset) { - this.offset = offset; - return this; - } - - /** - * Set query. - * - * @param query Search/filter query (supports field:value syntax). (optional) - * @return ListIndicatorsOfCompromiseOptionalParameters - */ - public ListIndicatorsOfCompromiseOptionalParameters query(String query) { - this.query = query; - return this; - } - - /** - * Set sortColumn. - * - * @param sortColumn Sort column: score, first_seen_ts_epoch, last_seen_ts_epoch, indicator, - * indicator_type, signal_count, log_count, category, as_type. (optional, default to - * "score") - * @return ListIndicatorsOfCompromiseOptionalParameters - */ - public ListIndicatorsOfCompromiseOptionalParameters sortColumn(String sortColumn) { - this.sortColumn = sortColumn; - return this; - } - - /** - * Set sortOrder. - * - * @param sortOrder Sort order: asc or desc. (optional, default to "desc") - * @return ListIndicatorsOfCompromiseOptionalParameters - */ - public ListIndicatorsOfCompromiseOptionalParameters sortOrder(String sortOrder) { - this.sortOrder = sortOrder; - return this; - } - - /** - * Set ocsf. - * - * @param ocsf When true, return only OCSF field-based matches. When false, return - * regex/message-based matches. (optional, default to true) - * @return ListIndicatorsOfCompromiseOptionalParameters - */ - public ListIndicatorsOfCompromiseOptionalParameters ocsf(Boolean ocsf) { - this.ocsf = ocsf; - return this; - } - - /** - * Set workedBy. - * - * @param workedBy Filter indicators whose triage state was updated by a specific user UUID. - * (optional) - * @return ListIndicatorsOfCompromiseOptionalParameters - */ - public ListIndicatorsOfCompromiseOptionalParameters workedBy(String workedBy) { - this.workedBy = workedBy; - return this; - } - - /** - * Set triageState. - * - * @param triageState Filter by triage state. (optional) - * @return ListIndicatorsOfCompromiseOptionalParameters - */ - public ListIndicatorsOfCompromiseOptionalParameters triageState(IoCTriageState triageState) { - this.triageState = triageState; - return this; - } - } - - /** - * List indicators of compromise. - * - *

See {@link #listIndicatorsOfCompromiseWithHttpInfo}. - * - * @return IoCExplorerListResponse - * @throws ApiException if fails to make API call - */ - public IoCExplorerListResponse listIndicatorsOfCompromise() throws ApiException { - return listIndicatorsOfCompromiseWithHttpInfo( - new ListIndicatorsOfCompromiseOptionalParameters()) - .getData(); - } - - /** - * List indicators of compromise. - * - *

See {@link #listIndicatorsOfCompromiseWithHttpInfoAsync}. - * - * @return CompletableFuture<IoCExplorerListResponse> - */ - public CompletableFuture listIndicatorsOfCompromiseAsync() { - return listIndicatorsOfCompromiseWithHttpInfoAsync( - new ListIndicatorsOfCompromiseOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType() {}); } /** - * List indicators of compromise. + * Get suppressions affecting future rule. * - *

See {@link #listIndicatorsOfCompromiseWithHttpInfo}. + *

See {@link #getSuppressionsAffectingFutureRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return IoCExplorerListResponse + * @param body (required) + * @return SecurityMonitoringSuppressionsResponse * @throws ApiException if fails to make API call */ - public IoCExplorerListResponse listIndicatorsOfCompromise( - ListIndicatorsOfCompromiseOptionalParameters parameters) throws ApiException { - return listIndicatorsOfCompromiseWithHttpInfo(parameters).getData(); + public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingFutureRule( + SecurityMonitoringRuleCreatePayload body) throws ApiException { + return getSuppressionsAffectingFutureRuleWithHttpInfo(body).getData(); } /** - * List indicators of compromise. + * Get suppressions affecting future rule. * - *

See {@link #listIndicatorsOfCompromiseWithHttpInfoAsync}. + *

See {@link #getSuppressionsAffectingFutureRuleWithHttpInfoAsync}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<IoCExplorerListResponse> + * @param body (required) + * @return CompletableFuture<SecurityMonitoringSuppressionsResponse> */ - public CompletableFuture listIndicatorsOfCompromiseAsync( - ListIndicatorsOfCompromiseOptionalParameters parameters) { - return listIndicatorsOfCompromiseWithHttpInfoAsync(parameters) + public CompletableFuture + getSuppressionsAffectingFutureRuleAsync(SecurityMonitoringRuleCreatePayload body) { + return getSuppressionsAffectingFutureRuleWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -16036,10 +15462,10 @@ public CompletableFuture listIndicatorsOfCompromiseAsyn } /** - * Get a list of indicators of compromise (IoCs) matching the specified filters. + * Get the list of suppressions that would affect a rule. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<IoCExplorerListResponse> + * @param body (required) + * @return ApiResponse<SecurityMonitoringSuppressionsResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -16051,156 +15477,124 @@ public CompletableFuture listIndicatorsOfCompromiseAsyn * *
429 Too many requests -
*/ - public ApiResponse listIndicatorsOfCompromiseWithHttpInfo( - ListIndicatorsOfCompromiseOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listIndicatorsOfCompromise"; - 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 + getSuppressionsAffectingFutureRuleWithHttpInfo(SecurityMonitoringRuleCreatePayload 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 getSuppressionsAffectingFutureRule"); } - Object localVarPostBody = null; - Integer limit = parameters.limit; - Integer offset = parameters.offset; - String query = parameters.query; - String sortColumn = parameters.sortColumn; - String sortOrder = parameters.sortOrder; - Boolean ocsf = parameters.ocsf; - String workedBy = parameters.workedBy; - IoCTriageState triageState = parameters.triageState; // create path and map variables - String localVarPath = "/api/v2/security/siem/ioc-explorer"; + String localVarPath = "/api/v2/security_monitoring/configuration/suppressions/rules"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[column]", sortColumn)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[order]", sortOrder)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "ocsf", ocsf)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "worked_by", workedBy)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "triage_state", triageState)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listIndicatorsOfCompromise", + "v2.SecurityMonitoringApi.getSuppressionsAffectingFutureRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List indicators of compromise. + * Get suppressions affecting future rule. * - *

See {@link #listIndicatorsOfCompromiseWithHttpInfo}. + *

See {@link #getSuppressionsAffectingFutureRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<IoCExplorerListResponse>> + * @param body (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionsResponse>> */ - public CompletableFuture> - listIndicatorsOfCompromiseWithHttpInfoAsync( - ListIndicatorsOfCompromiseOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "listIndicatorsOfCompromise"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> + getSuppressionsAffectingFutureRuleWithHttpInfoAsync( + SecurityMonitoringRuleCreatePayload body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " getSuppressionsAffectingFutureRule")); return result; } - Object localVarPostBody = null; - Integer limit = parameters.limit; - Integer offset = parameters.offset; - String query = parameters.query; - String sortColumn = parameters.sortColumn; - String sortOrder = parameters.sortOrder; - Boolean ocsf = parameters.ocsf; - String workedBy = parameters.workedBy; - IoCTriageState triageState = parameters.triageState; // create path and map variables - String localVarPath = "/api/v2/security/siem/ioc-explorer"; + String localVarPath = "/api/v2/security_monitoring/configuration/suppressions/rules"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[column]", sortColumn)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[order]", sortOrder)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "ocsf", ocsf)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "worked_by", workedBy)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "triage_state", triageState)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listIndicatorsOfCompromise", + "v2.SecurityMonitoringApi.getSuppressionsAffectingFutureRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Ruleset get multiple. + * Get suppressions affecting a specific rule. * - *

See {@link #listMultipleRulesetsWithHttpInfo}. + *

See {@link #getSuppressionsAffectingRuleWithHttpInfo}. * - * @param body (required) - * @return GetMultipleRulesetsResponse + * @param ruleId The ID of the rule. (required) + * @return SecurityMonitoringSuppressionsResponse * @throws ApiException if fails to make API call */ - public GetMultipleRulesetsResponse listMultipleRulesets(GetMultipleRulesetsRequest body) + public SecurityMonitoringSuppressionsResponse getSuppressionsAffectingRule(String ruleId) throws ApiException { - return listMultipleRulesetsWithHttpInfo(body).getData(); + return getSuppressionsAffectingRuleWithHttpInfo(ruleId).getData(); } /** - * Ruleset get multiple. + * Get suppressions affecting a specific rule. * - *

See {@link #listMultipleRulesetsWithHttpInfoAsync}. + *

See {@link #getSuppressionsAffectingRuleWithHttpInfoAsync}. * - * @param body (required) - * @return CompletableFuture<GetMultipleRulesetsResponse> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<SecurityMonitoringSuppressionsResponse> */ - public CompletableFuture listMultipleRulesetsAsync( - GetMultipleRulesetsRequest body) { - return listMultipleRulesetsWithHttpInfoAsync(body) + public CompletableFuture + getSuppressionsAffectingRuleAsync(String ruleId) { + return getSuppressionsAffectingRuleWithHttpInfoAsync(ruleId) .thenApply( response -> { return response.getData(); @@ -16208,43 +15602,40 @@ public CompletableFuture listMultipleRulesetsAsync( } /** - * Get rules for multiple rulesets in batch. + * Get the list of suppressions that affect a specific existing rule by its ID. * - * @param body (required) - * @return ApiResponse<GetMultipleRulesetsResponse> + * @param ruleId The ID of the rule. (required) + * @return ApiResponse<SecurityMonitoringSuppressionsResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse listMultipleRulesetsWithHttpInfo( - GetMultipleRulesetsRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listMultipleRulesets"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } - Object localVarPostBody = body; + public ApiResponse + getSuppressionsAffectingRuleWithHttpInfo(String ruleId) throws ApiException { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling listMultipleRulesets"); + 400, "Missing the required parameter 'ruleId' when calling getSuppressionsAffectingRule"); } // create path and map variables - String localVarPath = "/api/v2/static-analysis/rulesets"; + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listMultipleRulesets", + "v2.SecurityMonitoringApi.getSuppressionsAffectingRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -16252,50 +15643,42 @@ public ApiResponse listMultipleRulesetsWithHttpInfo new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "GET", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Ruleset get multiple. + * Get suppressions affecting a specific rule. * - *

See {@link #listMultipleRulesetsWithHttpInfo}. + *

See {@link #getSuppressionsAffectingRuleWithHttpInfo}. * - * @param body (required) - * @return CompletableFuture<ApiResponse<GetMultipleRulesetsResponse>> + * @param ruleId The ID of the rule. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringSuppressionsResponse>> */ - public CompletableFuture> - listMultipleRulesetsWithHttpInfoAsync(GetMultipleRulesetsRequest body) { - // Check if unstable operation is enabled - String operationId = "listMultipleRulesets"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } - Object localVarPostBody = body; + public CompletableFuture> + getSuppressionsAffectingRuleWithHttpInfoAsync(String ruleId) { + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling listMultipleRulesets")); + 400, + "Missing the required parameter 'ruleId' when calling getSuppressionsAffectingRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/static-analysis/rulesets"; + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -16303,7 +15686,7 @@ public ApiResponse listMultipleRulesetsWithHttpInfo try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listMultipleRulesets", + "v2.SecurityMonitoringApi.getSuppressionsAffectingRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -16311,131 +15694,113 @@ public ApiResponse listMultipleRulesetsWithHttpInfo new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "GET", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listSampleLogGenerationSubscriptions. */ - public static class ListSampleLogGenerationSubscriptionsOptionalParameters { - private SampleLogGenerationSubscriptionsStatusFilter status; - private OffsetDateTime startTimestamp; - private OffsetDateTime endTimestamp; - - /** - * Set status. - * - * @param status Filter the subscriptions by status. Use active to return only - * currently active subscriptions, or all to return every subscription - * including expired ones. Ignored when start_timestamp is provided. Defaults - * to active. (optional, default to "active") - * @return ListSampleLogGenerationSubscriptionsOptionalParameters - */ - public ListSampleLogGenerationSubscriptionsOptionalParameters status( - SampleLogGenerationSubscriptionsStatusFilter status) { - this.status = status; - return this; - } + /** Manage optional parameters to getSuppressionVersionHistory. */ + public static class GetSuppressionVersionHistoryOptionalParameters { + private Long pageSize; + private Long pageNumber; /** - * Set startTimestamp. + * Set pageSize. * - * @param startTimestamp The start of the time range, as an RFC3339 timestamp. When provided, - * the response includes every subscription that was active at any point in - * [start_timestamp, end_timestamp], and the status filter is ignored. - * (optional) - * @return ListSampleLogGenerationSubscriptionsOptionalParameters + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return GetSuppressionVersionHistoryOptionalParameters */ - public ListSampleLogGenerationSubscriptionsOptionalParameters startTimestamp( - OffsetDateTime startTimestamp) { - this.startTimestamp = startTimestamp; + public GetSuppressionVersionHistoryOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; return this; } /** - * Set endTimestamp. + * Set pageNumber. * - * @param endTimestamp The end of the time range, as an RFC3339 timestamp. Ignored unless - * start_timestamp is set. Defaults to the current time when start_timestamp - * is provided. (optional) - * @return ListSampleLogGenerationSubscriptionsOptionalParameters + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return GetSuppressionVersionHistoryOptionalParameters */ - public ListSampleLogGenerationSubscriptionsOptionalParameters endTimestamp( - OffsetDateTime endTimestamp) { - this.endTimestamp = endTimestamp; + public GetSuppressionVersionHistoryOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; return this; } } /** - * Get sample log generation subscriptions. + * Get a suppression's version history. * - *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfo}. + *

See {@link #getSuppressionVersionHistoryWithHttpInfo}. * - * @return SampleLogGenerationSubscriptionsResponse + * @param suppressionId The ID of the suppression rule (required) + * @return GetSuppressionVersionHistoryResponse * @throws ApiException if fails to make API call */ - public SampleLogGenerationSubscriptionsResponse listSampleLogGenerationSubscriptions() + public GetSuppressionVersionHistoryResponse getSuppressionVersionHistory(String suppressionId) throws ApiException { - return listSampleLogGenerationSubscriptionsWithHttpInfo( - new ListSampleLogGenerationSubscriptionsOptionalParameters()) + return getSuppressionVersionHistoryWithHttpInfo( + suppressionId, new GetSuppressionVersionHistoryOptionalParameters()) .getData(); } /** - * Get sample log generation subscriptions. + * Get a suppression's version history. * - *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfoAsync}. + *

See {@link #getSuppressionVersionHistoryWithHttpInfoAsync}. * - * @return CompletableFuture<SampleLogGenerationSubscriptionsResponse> + * @param suppressionId The ID of the suppression rule (required) + * @return CompletableFuture<GetSuppressionVersionHistoryResponse> */ - public CompletableFuture - listSampleLogGenerationSubscriptionsAsync() { - return listSampleLogGenerationSubscriptionsWithHttpInfoAsync( - new ListSampleLogGenerationSubscriptionsOptionalParameters()) - .thenApply( - response -> { - return response.getData(); + public CompletableFuture getSuppressionVersionHistoryAsync( + String suppressionId) { + return getSuppressionVersionHistoryWithHttpInfoAsync( + suppressionId, new GetSuppressionVersionHistoryOptionalParameters()) + .thenApply( + response -> { + return response.getData(); }); } /** - * Get sample log generation subscriptions. + * Get a suppression's version history. * - *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfo}. + *

See {@link #getSuppressionVersionHistoryWithHttpInfo}. * + * @param suppressionId The ID of the suppression rule (required) * @param parameters Optional parameters for the request. - * @return SampleLogGenerationSubscriptionsResponse + * @return GetSuppressionVersionHistoryResponse * @throws ApiException if fails to make API call */ - public SampleLogGenerationSubscriptionsResponse listSampleLogGenerationSubscriptions( - ListSampleLogGenerationSubscriptionsOptionalParameters parameters) throws ApiException { - return listSampleLogGenerationSubscriptionsWithHttpInfo(parameters).getData(); + public GetSuppressionVersionHistoryResponse getSuppressionVersionHistory( + String suppressionId, GetSuppressionVersionHistoryOptionalParameters parameters) + throws ApiException { + return getSuppressionVersionHistoryWithHttpInfo(suppressionId, parameters).getData(); } /** - * Get sample log generation subscriptions. + * Get a suppression's version history. * - *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfoAsync}. + *

See {@link #getSuppressionVersionHistoryWithHttpInfoAsync}. * + * @param suppressionId The ID of the suppression rule (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<SampleLogGenerationSubscriptionsResponse> + * @return CompletableFuture<GetSuppressionVersionHistoryResponse> */ - public CompletableFuture - listSampleLogGenerationSubscriptionsAsync( - ListSampleLogGenerationSubscriptionsOptionalParameters parameters) { - return listSampleLogGenerationSubscriptionsWithHttpInfoAsync(parameters) + public CompletableFuture getSuppressionVersionHistoryAsync( + String suppressionId, GetSuppressionVersionHistoryOptionalParameters parameters) { + return getSuppressionVersionHistoryWithHttpInfoAsync(suppressionId, parameters) .thenApply( response -> { return response.getData(); @@ -16443,55 +15808,51 @@ public SampleLogGenerationSubscriptionsResponse listSampleLogGenerationSubscript } /** - * Get the sample log generation subscriptions for the organization. Sample log generation injects - * representative example logs for a given Cloud SIEM content pack into the Logs platform, which - * can be used to test detection rules without onboarding the underlying integration first. - * - *

Availability: this endpoint is restricted to Cloud SIEM trial organizations - * on an eligible pricing model. Other organizations receive a 403 Forbidden - * (non-trial orgs) or a 400 Bad Request (feature disabled), and legacy pricing tiers - * receive a response with status: not_available. + * Get a suppression's version history. * + * @param suppressionId The ID of the suppression rule (required) * @param parameters Optional parameters for the request. - * @return ApiResponse<SampleLogGenerationSubscriptionsResponse> + * @return ApiResponse<GetSuppressionVersionHistoryResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - listSampleLogGenerationSubscriptionsWithHttpInfo( - ListSampleLogGenerationSubscriptionsOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listSampleLogGenerationSubscriptions"; - 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 getSuppressionVersionHistoryWithHttpInfo( + String suppressionId, GetSuppressionVersionHistoryOptionalParameters parameters) + throws ApiException { Object localVarPostBody = null; - SampleLogGenerationSubscriptionsStatusFilter status = parameters.status; - OffsetDateTime startTimestamp = parameters.startTimestamp; - OffsetDateTime endTimestamp = parameters.endTimestamp; + + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'suppressionId' when calling" + + " getSuppressionVersionHistory"); + } + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/sample_log_generation/subscriptions"; + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_timestamp", startTimestamp)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_timestamp", endTimestamp)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSampleLogGenerationSubscriptions", + "v2.SecurityMonitoringApi.getSuppressionVersionHistory", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -16506,50 +15867,53 @@ public SampleLogGenerationSubscriptionsResponse listSampleLogGenerationSubscript localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get sample log generation subscriptions. + * Get a suppression's version history. * - *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfo}. + *

See {@link #getSuppressionVersionHistoryWithHttpInfo}. * + * @param suppressionId The ID of the suppression rule (required) * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SampleLogGenerationSubscriptionsResponse>> + * @return CompletableFuture<ApiResponse<GetSuppressionVersionHistoryResponse>> */ - public CompletableFuture> - listSampleLogGenerationSubscriptionsWithHttpInfoAsync( - ListSampleLogGenerationSubscriptionsOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "listSampleLogGenerationSubscriptions"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = + public CompletableFuture> + getSuppressionVersionHistoryWithHttpInfoAsync( + String suppressionId, GetSuppressionVersionHistoryOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'suppressionId' is set + if (suppressionId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, + "Missing the required parameter 'suppressionId' when calling" + + " getSuppressionVersionHistory")); return result; } - Object localVarPostBody = null; - SampleLogGenerationSubscriptionsStatusFilter status = parameters.status; - OffsetDateTime startTimestamp = parameters.startTimestamp; - OffsetDateTime endTimestamp = parameters.endTimestamp; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/sample_log_generation/subscriptions"; + String localVarPath = + "/api/v2/security_monitoring/configuration/suppressions/{suppression_id}/version_history" + .replaceAll( + "\\{" + "suppression_id" + "\\}", apiClient.escapeString(suppressionId.toString())); List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_timestamp", startTimestamp)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_timestamp", endTimestamp)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSampleLogGenerationSubscriptions", + "v2.SecurityMonitoringApi.getSuppressionVersionHistory", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -16557,7 +15921,7 @@ public SampleLogGenerationSubscriptionsResponse listSampleLogGenerationSubscript new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -16570,113 +15934,33 @@ public SampleLogGenerationSubscriptionsResponse listSampleLogGenerationSubscript localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to listScannedAssetsMetadata. */ - public static class ListScannedAssetsMetadataOptionalParameters { - private String pageToken; - private Long pageNumber; - private CloudAssetType filterAssetType; - private String filterAssetName; - private String filterLastSuccessOrigin; - private String filterLastSuccessEnv; - - /** - * Set pageToken. - * - * @param pageToken Its value must come from the links section of the response of - * the first request. Do not manually edit it. (optional) - * @return ListScannedAssetsMetadataOptionalParameters - */ - public ListScannedAssetsMetadataOptionalParameters pageToken(String pageToken) { - this.pageToken = pageToken; - return this; - } - - /** - * Set pageNumber. - * - * @param pageNumber The page number to be retrieved. It should be equal to or greater than 1. - * (optional) - * @return ListScannedAssetsMetadataOptionalParameters - */ - public ListScannedAssetsMetadataOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; - return this; - } - - /** - * Set filterAssetType. - * - * @param filterAssetType The type of the scanned asset. (optional) - * @return ListScannedAssetsMetadataOptionalParameters - */ - public ListScannedAssetsMetadataOptionalParameters filterAssetType( - CloudAssetType filterAssetType) { - this.filterAssetType = filterAssetType; - return this; - } - - /** - * Set filterAssetName. - * - * @param filterAssetName The name of the scanned asset. (optional) - * @return ListScannedAssetsMetadataOptionalParameters - */ - public ListScannedAssetsMetadataOptionalParameters filterAssetName(String filterAssetName) { - this.filterAssetName = filterAssetName; - return this; - } - - /** - * Set filterLastSuccessOrigin. - * - * @param filterLastSuccessOrigin The origin of last success scan. (optional) - * @return ListScannedAssetsMetadataOptionalParameters - */ - public ListScannedAssetsMetadataOptionalParameters filterLastSuccessOrigin( - String filterLastSuccessOrigin) { - this.filterLastSuccessOrigin = filterLastSuccessOrigin; - return this; - } - - /** - * Set filterLastSuccessEnv. - * - * @param filterLastSuccessEnv The environment of last success scan. (optional) - * @return ListScannedAssetsMetadataOptionalParameters - */ - public ListScannedAssetsMetadataOptionalParameters filterLastSuccessEnv( - String filterLastSuccessEnv) { - this.filterLastSuccessEnv = filterLastSuccessEnv; - return this; - } + new GenericType() {}); } /** - * List scanned assets metadata. + * Get details of a vulnerability notification rule. * - *

See {@link #listScannedAssetsMetadataWithHttpInfo}. + *

See {@link #getVulnerabilityNotificationRuleWithHttpInfo}. * - * @return ScannedAssetsMetadata + * @param id ID of the notification rule. (required) + * @return NotificationRuleResponse * @throws ApiException if fails to make API call */ - public ScannedAssetsMetadata listScannedAssetsMetadata() throws ApiException { - return listScannedAssetsMetadataWithHttpInfo(new ListScannedAssetsMetadataOptionalParameters()) - .getData(); + public NotificationRuleResponse getVulnerabilityNotificationRule(String id) throws ApiException { + return getVulnerabilityNotificationRuleWithHttpInfo(id).getData(); } /** - * List scanned assets metadata. + * Get details of a vulnerability notification rule. * - *

See {@link #listScannedAssetsMetadataWithHttpInfoAsync}. + *

See {@link #getVulnerabilityNotificationRuleWithHttpInfoAsync}. * - * @return CompletableFuture<ScannedAssetsMetadata> + * @param id ID of the notification rule. (required) + * @return CompletableFuture<NotificationRuleResponse> */ - public CompletableFuture listScannedAssetsMetadataAsync() { - return listScannedAssetsMetadataWithHttpInfoAsync( - new ListScannedAssetsMetadataOptionalParameters()) + public CompletableFuture getVulnerabilityNotificationRuleAsync( + String id) { + return getVulnerabilityNotificationRuleWithHttpInfoAsync(id) .thenApply( response -> { return response.getData(); @@ -16684,142 +15968,43 @@ public CompletableFuture listScannedAssetsMetadataAsync() } /** - * List scanned assets metadata. - * - *

See {@link #listScannedAssetsMetadataWithHttpInfo}. + * Get the details of a notification rule for security vulnerabilities. * - * @param parameters Optional parameters for the request. - * @return ScannedAssetsMetadata - * @throws ApiException if fails to make API call - */ - public ScannedAssetsMetadata listScannedAssetsMetadata( - ListScannedAssetsMetadataOptionalParameters parameters) throws ApiException { - return listScannedAssetsMetadataWithHttpInfo(parameters).getData(); - } - - /** - * List scanned assets metadata. - * - *

See {@link #listScannedAssetsMetadataWithHttpInfoAsync}. - * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ScannedAssetsMetadata> - */ - public CompletableFuture listScannedAssetsMetadataAsync( - ListScannedAssetsMetadataOptionalParameters parameters) { - return listScannedAssetsMetadataWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Get a list of security scanned assets metadata for an organization. - * - *

Pagination

- * - *

For the "List Vulnerabilities" endpoint, see the Pagination - * section. - * - *

Filtering

- * - *

For the "List Vulnerabilities" endpoint, see the Filtering section. - * - *

Metadata

- * - *

For the "List Vulnerabilities" endpoint, see the Metadata section. - * - *

Related endpoints

- * - *

This endpoint returns additional metadata for cloud resources that is not available from the - * standard resource endpoints. To access a richer dataset, call this endpoint together with the - * relevant resource endpoint(s) and merge (join) their results using the resource identifier. - * - *

Hosts - * - *

To enrich host data, join the response from the Hosts endpoint with the response from - * the scanned-assets-metadata endpoint on the following key fields: - * - *

| ENDPOINT | JOIN KEY | TYPE | | --- | --- | --- | | /api/v1/hosts | host_list.host_name | - * string | | /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | - * - *

Host Images - * - *

To enrich host image data, join the response from the Hosts endpoint with the response from - * the scanned-assets-metadata endpoint on the following key fields: - * - *

| ENDPOINT | JOIN KEY | TYPE | | --- | --- | --- | | /api/v1/hosts | - * host_list.tags_by_source["Amazon Web Services"]["image"] | string | | - * /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | - * - *

Container Images - * - *

To enrich container image data, join the response from the Container Images endpoint - * with the response from the scanned-assets-metadata endpoint on the following key fields: - * - *

| ENDPOINT | JOIN KEY | TYPE | | --- | --- | --- | | /api/v2/container_images | - * data.attributes.name@data.attributes.repo_digest | string | | - * /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | - * - * @param parameters Optional parameters for the request. - * @return ApiResponse<ScannedAssetsMetadata> + * @param id ID of the notification rule. (required) + * @return ApiResponse<NotificationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * - * + * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: asset not found -
200 Notification rule details. -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse listScannedAssetsMetadataWithHttpInfo( - ListScannedAssetsMetadataOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listScannedAssetsMetadata"; - 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 getVulnerabilityNotificationRuleWithHttpInfo( + String id) throws ApiException { Object localVarPostBody = null; - String pageToken = parameters.pageToken; - Long pageNumber = parameters.pageNumber; - CloudAssetType filterAssetType = parameters.filterAssetType; - String filterAssetName = parameters.filterAssetName; - String filterLastSuccessOrigin = parameters.filterLastSuccessOrigin; - String filterLastSuccessEnv = parameters.filterLastSuccessEnv; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getVulnerabilityNotificationRule"); + } // create path and map variables - String localVarPath = "/api/v2/security/scanned-assets-metadata"; + String localVarPath = + "/api/v2/security/vulnerabilities/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.type]", filterAssetType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[last_success.origin]", filterLastSuccessOrigin)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[last_success.env]", filterLastSuccessEnv)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listScannedAssetsMetadata", + "v2.SecurityMonitoringApi.getVulnerabilityNotificationRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, @@ -16832,67 +16017,50 @@ public ApiResponse listScannedAssetsMetadataWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List scanned assets metadata. + * Get details of a vulnerability notification rule. * - *

See {@link #listScannedAssetsMetadataWithHttpInfo}. + *

See {@link #getVulnerabilityNotificationRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ScannedAssetsMetadata>> + * @param id ID of the notification rule. (required) + * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> */ - public CompletableFuture> - listScannedAssetsMetadataWithHttpInfoAsync( - ListScannedAssetsMetadataOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "listScannedAssetsMetadata"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> + getVulnerabilityNotificationRuleWithHttpInfoAsync(String id) { + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, + "Missing the required parameter 'id' when calling getVulnerabilityNotificationRule")); return result; } - Object localVarPostBody = null; - String pageToken = parameters.pageToken; - Long pageNumber = parameters.pageNumber; - CloudAssetType filterAssetType = parameters.filterAssetType; - String filterAssetName = parameters.filterAssetName; - String filterLastSuccessOrigin = parameters.filterLastSuccessOrigin; - String filterLastSuccessEnv = parameters.filterLastSuccessEnv; // create path and map variables - String localVarPath = "/api/v2/security/scanned-assets-metadata"; + String localVarPath = + "/api/v2/security/vulnerabilities/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.type]", filterAssetType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[last_success.origin]", filterLastSuccessOrigin)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[last_success.env]", filterLastSuccessEnv)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listScannedAssetsMetadata", + "v2.SecurityMonitoringApi.getVulnerabilityNotificationRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -16904,30 +16072,30 @@ public ApiResponse listScannedAssetsMetadataWithHttpInfo( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all security filters. + * Get the list of vulnerability notification rules. * - *

See {@link #listSecurityFiltersWithHttpInfo}. + *

See {@link #getVulnerabilityNotificationRulesWithHttpInfo}. * - * @return SecurityFiltersResponse + * @return NotificationRulesListResponse * @throws ApiException if fails to make API call */ - public SecurityFiltersResponse listSecurityFilters() throws ApiException { - return listSecurityFiltersWithHttpInfo().getData(); + public NotificationRulesListResponse getVulnerabilityNotificationRules() throws ApiException { + return getVulnerabilityNotificationRulesWithHttpInfo().getData(); } /** - * Get all security filters. + * Get the list of vulnerability notification rules. * - *

See {@link #listSecurityFiltersWithHttpInfoAsync}. + *

See {@link #getVulnerabilityNotificationRulesWithHttpInfoAsync}. * - * @return CompletableFuture<SecurityFiltersResponse> + * @return CompletableFuture<NotificationRulesListResponse> */ - public CompletableFuture listSecurityFiltersAsync() { - return listSecurityFiltersWithHttpInfoAsync() + public CompletableFuture getVulnerabilityNotificationRulesAsync() { + return getVulnerabilityNotificationRulesWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -16935,36 +16103,36 @@ public CompletableFuture listSecurityFiltersAsync() { } /** - * Get the list of configured security filters with their definitions. + * Returns the list of notification rules for security vulnerabilities. * - * @return ApiResponse<SecurityFiltersResponse> + * @return ApiResponse<NotificationRulesListResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
200 The list of notification rules. -
403 Forbidden -
429 Too many requests -
*/ - public ApiResponse listSecurityFiltersWithHttpInfo() + public ApiResponse getVulnerabilityNotificationRulesWithHttpInfo() throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/security_filters"; + String localVarPath = "/api/v2/security/vulnerabilities/notification_rules"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityFilters", + "v2.SecurityMonitoringApi.getVulnerabilityNotificationRules", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -16973,21 +16141,21 @@ public ApiResponse listSecurityFiltersWithHttpInfo() localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all security filters. + * Get the list of vulnerability notification rules. * - *

See {@link #listSecurityFiltersWithHttpInfo}. + *

See {@link #getVulnerabilityNotificationRulesWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<SecurityFiltersResponse>> + * @return CompletableFuture<ApiResponse<NotificationRulesListResponse>> */ - public CompletableFuture> - listSecurityFiltersWithHttpInfoAsync() { + public CompletableFuture> + getVulnerabilityNotificationRulesWithHttpInfoAsync() { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/security_filters"; + String localVarPath = "/api/v2/security/vulnerabilities/notification_rules"; Map localVarHeaderParams = new HashMap(); @@ -16995,15 +16163,16 @@ public ApiResponse listSecurityFiltersWithHttpInfo() try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityFilters", + "v2.SecurityMonitoringApi.getVulnerabilityNotificationRules", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -17015,197 +16184,137 @@ public ApiResponse listSecurityFiltersWithHttpInfo() localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** - * Get the version history of security filters. - * - *

See {@link #listSecurityFilterVersionsWithHttpInfo}. - * - * @return SecurityFilterVersionsResponse - * @throws ApiException if fails to make API call - */ - public SecurityFilterVersionsResponse listSecurityFilterVersions() throws ApiException { - return listSecurityFilterVersionsWithHttpInfo().getData(); - } - - /** - * Get the version history of security filters. - * - *

See {@link #listSecurityFilterVersionsWithHttpInfoAsync}. - * - * @return CompletableFuture<SecurityFilterVersionsResponse> - */ - public CompletableFuture listSecurityFilterVersionsAsync() { - return listSecurityFilterVersionsWithHttpInfoAsync() - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Get the configured security filters at each historical version of the configuration. Each entry - * in the response represents the set of all security filters at a given version, ordered from the - * most recent version to the oldest. - * - * @return ApiResponse<SecurityFilterVersionsResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
- */ - public ApiResponse listSecurityFilterVersionsWithHttpInfo() - throws ApiException { - Object localVarPostBody = null; - // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/security_filters/versions"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityFilterVersions", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } + /** Manage optional parameters to listAssetsSBOMs. */ + public static class ListAssetsSBOMsOptionalParameters { + private String pageToken; + private Long pageNumber; + private AssetType filterAssetType; + private String filterAssetName; + private String filterPackageName; + private String filterPackageVersion; + private String filterLicenseName; + private SBOMComponentLicenseType filterLicenseType; - /** - * Get the version history of security filters. - * - *

See {@link #listSecurityFilterVersionsWithHttpInfo}. - * - * @return CompletableFuture<ApiResponse<SecurityFilterVersionsResponse>> - */ - public CompletableFuture> - listSecurityFilterVersionsWithHttpInfoAsync() { - Object localVarPostBody = null; - // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/security_filters/versions"; + /** + * Set pageToken. + * + * @param pageToken Its value must come from the links section of the response of + * the first request. Do not manually edit it. (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters pageToken(String pageToken) { + this.pageToken = pageToken; + return this; + } - Map localVarHeaderParams = new HashMap(); + /** + * Set pageNumber. + * + * @param pageNumber The page number to be retrieved. It should be equal to or greater than 1. + * (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityFilterVersions", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; + /** + * Set filterAssetType. + * + * @param filterAssetType The type of the assets for the SBOM request. (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters filterAssetType(AssetType filterAssetType) { + this.filterAssetType = filterAssetType; + return this; } - return apiClient.invokeAPIAsync( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - /** Manage optional parameters to listSecurityFindings. */ - public static class ListSecurityFindingsOptionalParameters { - private String filterQuery; - private String pageCursor; - private Long pageLimit; - private SecurityFindingsSort sort; + /** + * Set filterAssetName. + * + * @param filterAssetName The name of the asset for the SBOM request. (optional) + * @return ListAssetsSBOMsOptionalParameters + */ + public ListAssetsSBOMsOptionalParameters filterAssetName(String filterAssetName) { + this.filterAssetName = filterAssetName; + return this; + } /** - * Set filterQuery. + * Set filterPackageName. * - * @param filterQuery The search query following log search syntax. (optional, default to "*") - * @return ListSecurityFindingsOptionalParameters + * @param filterPackageName The name of the component that is a dependency of an asset. + * (optional) + * @return ListAssetsSBOMsOptionalParameters */ - public ListSecurityFindingsOptionalParameters filterQuery(String filterQuery) { - this.filterQuery = filterQuery; + public ListAssetsSBOMsOptionalParameters filterPackageName(String filterPackageName) { + this.filterPackageName = filterPackageName; return this; } /** - * Set pageCursor. + * Set filterPackageVersion. * - * @param pageCursor Get the next page of results with a cursor provided in the previous query. + * @param filterPackageVersion The version of the component that is a dependency of an asset. * (optional) - * @return ListSecurityFindingsOptionalParameters + * @return ListAssetsSBOMsOptionalParameters */ - public ListSecurityFindingsOptionalParameters pageCursor(String pageCursor) { - this.pageCursor = pageCursor; + public ListAssetsSBOMsOptionalParameters filterPackageVersion(String filterPackageVersion) { + this.filterPackageVersion = filterPackageVersion; return this; } /** - * Set pageLimit. + * Set filterLicenseName. * - * @param pageLimit The maximum number of findings in the response. (optional, default to 10) - * @return ListSecurityFindingsOptionalParameters + * @param filterLicenseName The software license name of the component that is a dependency of + * an asset. (optional) + * @return ListAssetsSBOMsOptionalParameters */ - public ListSecurityFindingsOptionalParameters pageLimit(Long pageLimit) { - this.pageLimit = pageLimit; + public ListAssetsSBOMsOptionalParameters filterLicenseName(String filterLicenseName) { + this.filterLicenseName = filterLicenseName; return this; } /** - * Set sort. + * Set filterLicenseType. * - * @param sort Sorts by @detection_changed_at. (optional, default to "-@detection_changed_at") - * @return ListSecurityFindingsOptionalParameters + * @param filterLicenseType The software license type of the component that is a dependency of + * an asset. (optional) + * @return ListAssetsSBOMsOptionalParameters */ - public ListSecurityFindingsOptionalParameters sort(SecurityFindingsSort sort) { - this.sort = sort; + public ListAssetsSBOMsOptionalParameters filterLicenseType( + SBOMComponentLicenseType filterLicenseType) { + this.filterLicenseType = filterLicenseType; return this; } } /** - * List security findings. + * List assets SBOMs. * - *

See {@link #listSecurityFindingsWithHttpInfo}. + *

See {@link #listAssetsSBOMsWithHttpInfo}. * - * @return ListSecurityFindingsResponse + * @return ListAssetsSBOMsResponse * @throws ApiException if fails to make API call */ - public ListSecurityFindingsResponse listSecurityFindings() throws ApiException { - return listSecurityFindingsWithHttpInfo(new ListSecurityFindingsOptionalParameters()).getData(); + public ListAssetsSBOMsResponse listAssetsSBOMs() throws ApiException { + return listAssetsSBOMsWithHttpInfo(new ListAssetsSBOMsOptionalParameters()).getData(); } /** - * List security findings. + * List assets SBOMs. * - *

See {@link #listSecurityFindingsWithHttpInfoAsync}. + *

See {@link #listAssetsSBOMsWithHttpInfoAsync}. * - * @return CompletableFuture<ListSecurityFindingsResponse> + * @return CompletableFuture<ListAssetsSBOMsResponse> */ - public CompletableFuture listSecurityFindingsAsync() { - return listSecurityFindingsWithHttpInfoAsync(new ListSecurityFindingsOptionalParameters()) + public CompletableFuture listAssetsSBOMsAsync() { + return listAssetsSBOMsWithHttpInfoAsync(new ListAssetsSBOMsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -17213,30 +16322,30 @@ public CompletableFuture listSecurityFindingsAsync } /** - * List security findings. + * List assets SBOMs. * - *

See {@link #listSecurityFindingsWithHttpInfo}. + *

See {@link #listAssetsSBOMsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return ListSecurityFindingsResponse + * @return ListAssetsSBOMsResponse * @throws ApiException if fails to make API call */ - public ListSecurityFindingsResponse listSecurityFindings( - ListSecurityFindingsOptionalParameters parameters) throws ApiException { - return listSecurityFindingsWithHttpInfo(parameters).getData(); + public ListAssetsSBOMsResponse listAssetsSBOMs(ListAssetsSBOMsOptionalParameters parameters) + throws ApiException { + return listAssetsSBOMsWithHttpInfo(parameters).getData(); } /** - * List security findings. + * List assets SBOMs. * - *

See {@link #listSecurityFindingsWithHttpInfoAsync}. + *

See {@link #listAssetsSBOMsWithHttpInfoAsync}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListSecurityFindingsResponse> + * @return CompletableFuture<ListAssetsSBOMsResponse> */ - public CompletableFuture listSecurityFindingsAsync( - ListSecurityFindingsOptionalParameters parameters) { - return listSecurityFindingsWithHttpInfoAsync(parameters) + public CompletableFuture listAssetsSBOMsAsync( + ListAssetsSBOMsOptionalParameters parameters) { + return listAssetsSBOMsWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -17244,113 +16353,78 @@ public CompletableFuture listSecurityFindingsAsync } /** - * List security findings. + * Get a list of assets SBOMs for an organization. * - *

See {@link #listSecurityFindingsWithHttpInfo}. + *

Pagination

* - * @return PaginationIterable<SecurityFindingsData> - */ - public PaginationIterable listSecurityFindingsWithPagination() { - ListSecurityFindingsOptionalParameters parameters = - new ListSecurityFindingsOptionalParameters(); - return listSecurityFindingsWithPagination(parameters); - } - - /** - * List security findings. - * - *

See {@link #listSecurityFindingsWithHttpInfo}. + *

Please review the Pagination section for the "List + * Vulnerabilities" endpoint. * - * @return ListSecurityFindingsResponse - */ - public PaginationIterable listSecurityFindingsWithPagination( - ListSecurityFindingsOptionalParameters parameters) { - String resultsPath = "getData"; - String valueGetterPath = "getMeta.getPage.getAfter"; - String valueSetterPath = "pageCursor"; - Boolean valueSetterParamOptional = true; - Long limit; - - if (parameters.pageLimit == null) { - limit = 10l; - parameters.pageLimit(limit); - } else { - limit = parameters.pageLimit; - } - - LinkedHashMap args = new LinkedHashMap(); - args.put("optionalParams", parameters); - - PaginationIterable iterator = - new PaginationIterable( - this, - "listSecurityFindings", - resultsPath, - valueGetterPath, - valueSetterPath, - valueSetterParamOptional, - true, - true, - limit, - args, - 0); - - return iterator; - } - - /** - * Get a list of security findings that match a search query. See the schema for security - * findings. + *

Filtering

* - *

Query Syntax

+ *

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

This endpoint uses the logs query syntax. Findings attributes (living in the - * attributes.attributes. namespace) are prefixed by @ when queried. Tags are queried without a - * prefix. + *

Metadata

* - *

Example: @severity:(critical OR high) @status:open team:platform + *

Please review the Metadata section for the "List Vulnerabilities" + * endpoint. * * @param parameters Optional parameters for the request. - * @return ApiResponse<ListSecurityFindingsResponse> + * @return ApiResponse<ListAssetsSBOMsResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: asset not found -
429 Too many requests -
*/ - public ApiResponse listSecurityFindingsWithHttpInfo( - ListSecurityFindingsOptionalParameters parameters) throws ApiException { + public ApiResponse listAssetsSBOMsWithHttpInfo( + ListAssetsSBOMsOptionalParameters parameters) throws ApiException { Object localVarPostBody = null; - String filterQuery = parameters.filterQuery; - String pageCursor = parameters.pageCursor; - Long pageLimit = parameters.pageLimit; - SecurityFindingsSort sort = parameters.sort; + String pageToken = parameters.pageToken; + Long pageNumber = parameters.pageNumber; + AssetType filterAssetType = parameters.filterAssetType; + String filterAssetName = parameters.filterAssetName; + String filterPackageName = parameters.filterPackageName; + String filterPackageVersion = parameters.filterPackageVersion; + String filterLicenseName = parameters.filterLicenseName; + SBOMComponentLicenseType filterLicenseType = parameters.filterLicenseType; // create path and map variables - String localVarPath = "/api/v2/security/findings"; + String localVarPath = "/api/v2/security/sboms"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_type]", filterAssetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[package_name]", filterPackageName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[package_version]", filterPackageVersion)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[license_name]", filterLicenseName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[license_type]", filterLicenseType)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityFindings", + "v2.SecurityMonitoringApi.listAssetsSBOMs", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -17359,49 +16433,62 @@ public ApiResponse listSecurityFindingsWithHttpInf localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List security findings. + * List assets SBOMs. * - *

See {@link #listSecurityFindingsWithHttpInfo}. + *

See {@link #listAssetsSBOMsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<ListSecurityFindingsResponse>> + * @return CompletableFuture<ApiResponse<ListAssetsSBOMsResponse>> */ - public CompletableFuture> - listSecurityFindingsWithHttpInfoAsync(ListSecurityFindingsOptionalParameters parameters) { + public CompletableFuture> listAssetsSBOMsWithHttpInfoAsync( + ListAssetsSBOMsOptionalParameters parameters) { Object localVarPostBody = null; - String filterQuery = parameters.filterQuery; - String pageCursor = parameters.pageCursor; - Long pageLimit = parameters.pageLimit; - SecurityFindingsSort sort = parameters.sort; + String pageToken = parameters.pageToken; + Long pageNumber = parameters.pageNumber; + AssetType filterAssetType = parameters.filterAssetType; + String filterAssetName = parameters.filterAssetName; + String filterPackageName = parameters.filterPackageName; + String filterPackageVersion = parameters.filterPackageVersion; + String filterLicenseName = parameters.filterLicenseName; + SBOMComponentLicenseType filterLicenseType = parameters.filterLicenseType; // create path and map variables - String localVarPath = "/api/v2/security/findings"; + String localVarPath = "/api/v2/security/sboms"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_type]", filterAssetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset_name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[package_name]", filterPackageName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[package_version]", filterPackageVersion)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[license_name]", filterLicenseName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[license_type]", filterLicenseType)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityFindings", + "v2.SecurityMonitoringApi.listAssetsSBOMs", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -17413,203 +16500,224 @@ public ApiResponse listSecurityFindingsWithHttpInf localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** - * Get all critical assets. - * - *

See {@link #listSecurityMonitoringCriticalAssetsWithHttpInfo}. - * - * @return SecurityMonitoringCriticalAssetsResponse - * @throws ApiException if fails to make API call - */ - public SecurityMonitoringCriticalAssetsResponse listSecurityMonitoringCriticalAssets() - throws ApiException { - return listSecurityMonitoringCriticalAssetsWithHttpInfo().getData(); - } + /** Manage optional parameters to listFindings. */ + public static class ListFindingsOptionalParameters { + private Long pageLimit; + private Long snapshotTimestamp; + private String pageCursor; + private String filterTags; + private String filterEvaluationChangedAt; + private Boolean filterMuted; + private String filterRuleId; + private String filterRuleName; + private String filterResourceType; + private String filterResourceId; + private String filterDiscoveryTimestamp; + private FindingEvaluation filterEvaluation; + private FindingStatus filterStatus; + private List filterVulnerabilityType; + private Boolean detailedFindings; - /** - * Get all critical assets. - * - *

See {@link #listSecurityMonitoringCriticalAssetsWithHttpInfoAsync}. - * - * @return CompletableFuture<SecurityMonitoringCriticalAssetsResponse> - */ - public CompletableFuture - listSecurityMonitoringCriticalAssetsAsync() { - return listSecurityMonitoringCriticalAssetsWithHttpInfoAsync() - .thenApply( - response -> { - return response.getData(); - }); - } + /** + * Set pageLimit. + * + * @param pageLimit Limit the number of findings returned. Must be <= 1000. (optional, + * default to 100) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; + return this; + } - /** - * Get the list of all critical assets. - * - * @return ApiResponse<SecurityMonitoringCriticalAssetsResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
- */ - public ApiResponse - listSecurityMonitoringCriticalAssetsWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/critical_assets"; + /** + * Set snapshotTimestamp. + * + * @param snapshotTimestamp Return findings for a given snapshot of time (Unix ms). (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters snapshotTimestamp(Long snapshotTimestamp) { + this.snapshotTimestamp = snapshotTimestamp; + return this; + } - Map localVarHeaderParams = new HashMap(); + /** + * Set pageCursor. + * + * @param pageCursor Return the next page of findings pointed to by the cursor. (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; + return this; + } - Invocation.Builder builder = - apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringCriticalAssets", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - return apiClient.invokeAPI( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } + /** + * Set filterTags. + * + * @param filterTags Return findings that have these associated tags (repeatable). (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterTags(String filterTags) { + this.filterTags = filterTags; + return this; + } - /** - * Get all critical assets. - * - *

See {@link #listSecurityMonitoringCriticalAssetsWithHttpInfo}. - * - * @return CompletableFuture<ApiResponse<SecurityMonitoringCriticalAssetsResponse>> - */ - public CompletableFuture> - listSecurityMonitoringCriticalAssetsWithHttpInfoAsync() { - Object localVarPostBody = null; - // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/critical_assets"; + /** + * Set filterEvaluationChangedAt. + * + * @param filterEvaluationChangedAt Return findings that have changed from pass to fail or vice + * versa on a specified date (Unix ms) or date range (using comparison operators). + * (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterEvaluationChangedAt( + String filterEvaluationChangedAt) { + this.filterEvaluationChangedAt = filterEvaluationChangedAt; + return this; + } - Map localVarHeaderParams = new HashMap(); + /** + * Set filterMuted. + * + * @param filterMuted Set to true to return findings that are muted. Set to + * false to return unmuted findings. (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterMuted(Boolean filterMuted) { + this.filterMuted = filterMuted; + return this; + } - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringCriticalAssets", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; + /** + * Set filterRuleId. + * + * @param filterRuleId Return findings for the specified rule ID. (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterRuleId(String filterRuleId) { + this.filterRuleId = filterRuleId; + return this; } - return apiClient.invokeAPIAsync( - "GET", - builder, - localVarHeaderParams, - new String[] {}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - /** Manage optional parameters to listSecurityMonitoringDatasets. */ - public static class ListSecurityMonitoringDatasetsOptionalParameters { - private Long pageSize; - private Long pageNumber; - private String sort; - private String filterQuery; + /** + * Set filterRuleName. + * + * @param filterRuleName Return findings for the specified rule. (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterRuleName(String filterRuleName) { + this.filterRuleName = filterRuleName; + return this; + } /** - * Set pageSize. + * Set filterResourceType. * - * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default - * to 50) - * @return ListSecurityMonitoringDatasetsOptionalParameters + * @param filterResourceType Return only findings for the specified resource type. (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringDatasetsOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; + public ListFindingsOptionalParameters filterResourceType(String filterResourceType) { + this.filterResourceType = filterResourceType; return this; } /** - * Set pageNumber. + * Set filterResourceId. * - * @param pageNumber Specific page number to return. (optional, default to 1) - * @return ListSecurityMonitoringDatasetsOptionalParameters + * @param filterResourceId Return only findings for the specified resource id. (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringDatasetsOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; + public ListFindingsOptionalParameters filterResourceId(String filterResourceId) { + this.filterResourceId = filterResourceId; return this; } /** - * Set sort. + * Set filterDiscoveryTimestamp. * - * @param sort Attribute used to sort datasets. Prefix with - to sort in descending - * order. (optional) - * @return ListSecurityMonitoringDatasetsOptionalParameters + * @param filterDiscoveryTimestamp Return findings that were found on a specified date (Unix ms) + * or date range (using comparison operators). (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringDatasetsOptionalParameters sort(String sort) { - this.sort = sort; + public ListFindingsOptionalParameters filterDiscoveryTimestamp( + String filterDiscoveryTimestamp) { + this.filterDiscoveryTimestamp = filterDiscoveryTimestamp; return this; } /** - * Set filterQuery. + * Set filterEvaluation. * - * @param filterQuery A search query to filter datasets by name or description. (optional) - * @return ListSecurityMonitoringDatasetsOptionalParameters + * @param filterEvaluation Return only pass or fail findings. + * (optional) + * @return ListFindingsOptionalParameters */ - public ListSecurityMonitoringDatasetsOptionalParameters filterQuery(String filterQuery) { - this.filterQuery = filterQuery; + public ListFindingsOptionalParameters filterEvaluation(FindingEvaluation filterEvaluation) { + this.filterEvaluation = filterEvaluation; + return this; + } + + /** + * Set filterStatus. + * + * @param filterStatus Return only findings with the specified status. (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterStatus(FindingStatus filterStatus) { + this.filterStatus = filterStatus; + return this; + } + + /** + * Set filterVulnerabilityType. + * + * @param filterVulnerabilityType Return findings that match the selected vulnerability types + * (repeatable). (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters filterVulnerabilityType( + List filterVulnerabilityType) { + this.filterVulnerabilityType = filterVulnerabilityType; + return this; + } + + /** + * Set detailedFindings. + * + * @param detailedFindings Return additional fields for some findings. (optional) + * @return ListFindingsOptionalParameters + */ + public ListFindingsOptionalParameters detailedFindings(Boolean detailedFindings) { + this.detailedFindings = detailedFindings; return this; } } /** - * List datasets. + * List findings. * - *

See {@link #listSecurityMonitoringDatasetsWithHttpInfo}. + *

See {@link #listFindingsWithHttpInfo}. * - * @return SecurityMonitoringDatasetsListResponse + * @return ListFindingsResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringDatasetsListResponse listSecurityMonitoringDatasets() - throws ApiException { - return listSecurityMonitoringDatasetsWithHttpInfo( - new ListSecurityMonitoringDatasetsOptionalParameters()) - .getData(); + public ListFindingsResponse listFindings() throws ApiException { + return listFindingsWithHttpInfo(new ListFindingsOptionalParameters()).getData(); } /** - * List datasets. + * List findings. * - *

See {@link #listSecurityMonitoringDatasetsWithHttpInfoAsync}. + *

See {@link #listFindingsWithHttpInfoAsync}. * - * @return CompletableFuture<SecurityMonitoringDatasetsListResponse> + * @return CompletableFuture<ListFindingsResponse> */ - public CompletableFuture - listSecurityMonitoringDatasetsAsync() { - return listSecurityMonitoringDatasetsWithHttpInfoAsync( - new ListSecurityMonitoringDatasetsOptionalParameters()) + public CompletableFuture listFindingsAsync() { + return listFindingsWithHttpInfoAsync(new ListFindingsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -17617,31 +16725,30 @@ public SecurityMonitoringDatasetsListResponse listSecurityMonitoringDatasets() } /** - * List datasets. + * List findings. * - *

See {@link #listSecurityMonitoringDatasetsWithHttpInfo}. + *

See {@link #listFindingsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return SecurityMonitoringDatasetsListResponse + * @return ListFindingsResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringDatasetsListResponse listSecurityMonitoringDatasets( - ListSecurityMonitoringDatasetsOptionalParameters parameters) throws ApiException { - return listSecurityMonitoringDatasetsWithHttpInfo(parameters).getData(); + public ListFindingsResponse listFindings(ListFindingsOptionalParameters parameters) + throws ApiException { + return listFindingsWithHttpInfo(parameters).getData(); } /** - * List datasets. + * List findings. * - *

See {@link #listSecurityMonitoringDatasetsWithHttpInfoAsync}. + *

See {@link #listFindingsWithHttpInfoAsync}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringDatasetsListResponse> + * @return CompletableFuture<ListFindingsResponse> */ - public CompletableFuture - listSecurityMonitoringDatasetsAsync( - ListSecurityMonitoringDatasetsOptionalParameters parameters) { - return listSecurityMonitoringDatasetsWithHttpInfoAsync(parameters) + public CompletableFuture listFindingsAsync( + ListFindingsOptionalParameters parameters) { + return listFindingsWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -17649,51 +16756,198 @@ public SecurityMonitoringDatasetsListResponse listSecurityMonitoringDatasets( } /** - * List all Cloud SIEM datasets available to the organization, including both customer-defined - * datasets and Datadog out-of-the-box datasets. + * List findings. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringDatasetsListResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * + *

See {@link #listFindingsWithHttpInfo}. + * + * @return PaginationIterable<Finding> + */ + public PaginationIterable listFindingsWithPagination() { + ListFindingsOptionalParameters parameters = new ListFindingsOptionalParameters(); + return listFindingsWithPagination(parameters); + } + + /** + * List findings. + * + *

See {@link #listFindingsWithHttpInfo}. + * + * @return ListFindingsResponse + */ + public PaginationIterable listFindingsWithPagination( + ListFindingsOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = "getMeta.getPage.getCursor"; + String valueSetterPath = "pageCursor"; + Boolean valueSetterParamOptional = true; + Long limit; + + if (parameters.pageLimit == null) { + limit = 100l; + parameters.pageLimit(limit); + } else { + limit = parameters.pageLimit; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "listFindings", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + true, + limit, + args, + 0); + + return iterator; + } + + /** + * Get a list of findings. These include both misconfigurations and identity risks. + * + *

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

Filtering

+ * + *

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

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

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

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

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

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

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

Additional extension fields

+ * + *

Additional extension fields are available for some findings. + * + *

The data is available when you include the query parameter ?detailed_findings=true + * in the request. + * + *

The following fields are available for findings: - external_id: The resource + * external ID related to the finding. - description: The description and remediation + * steps for the finding. - datadog_link: The Datadog relative link for the finding. + * - ip_addresses: The list of private IP addresses for the resource related to the + * finding. + * + *

Response

+ * + *

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

Each finding object contains the following: + * + *

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

See {@link #listSecurityMonitoringDatasetsWithHttpInfo}. + *

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

See {@link #listSecurityMonitoringHistsignalsWithHttpInfo}. + *

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

See {@link #listSecurityMonitoringHistsignalsWithHttpInfoAsync}. + *

See {@link #listHistoricalJobsWithHttpInfoAsync}. * - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + * @return CompletableFuture<ListHistoricalJobsResponse> */ - public CompletableFuture - listSecurityMonitoringHistsignalsAsync() { - return listSecurityMonitoringHistsignalsWithHttpInfoAsync( - new ListSecurityMonitoringHistsignalsOptionalParameters()) + public CompletableFuture listHistoricalJobsAsync() { + return listHistoricalJobsWithHttpInfoAsync(new ListHistoricalJobsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -17890,31 +17139,30 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringHistsignals() } /** - * List hist signals. + * List historical jobs. * - *

See {@link #listSecurityMonitoringHistsignalsWithHttpInfo}. + *

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

See {@link #listSecurityMonitoringHistsignalsWithHttpInfoAsync}. + *

See {@link #listHistoricalJobsWithHttpInfoAsync}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + * @return CompletableFuture<ListHistoricalJobsResponse> */ - public CompletableFuture - listSecurityMonitoringHistsignalsAsync( - ListSecurityMonitoringHistsignalsOptionalParameters parameters) { - return listSecurityMonitoringHistsignalsWithHttpInfoAsync(parameters) + public CompletableFuture listHistoricalJobsAsync( + ListHistoricalJobsOptionalParameters parameters) { + return listHistoricalJobsWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -17922,10 +17170,10 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringHistsignals( } /** - * List hist signals. + * List historical jobs. * * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringSignalsListResponse> + * @return ApiResponse<ListHistoricalJobsResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -17934,43 +17182,37 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringHistsignals( * * * - * * *
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - listSecurityMonitoringHistsignalsWithHttpInfo( - ListSecurityMonitoringHistsignalsOptionalParameters parameters) throws ApiException { + public ApiResponse listHistoricalJobsWithHttpInfo( + ListHistoricalJobsOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "listSecurityMonitoringHistsignals"; + String operationId = "listHistoricalJobs"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String sort = parameters.sort; String filterQuery = parameters.filterQuery; - OffsetDateTime filterFrom = parameters.filterFrom; - OffsetDateTime filterTo = parameters.filterTo; - SecurityMonitoringSignalsSort sort = parameters.sort; - String pageCursor = parameters.pageCursor; - Integer pageLimit = parameters.pageLimit; // create path and map variables - String localVarPath = "/api/v2/siem-historical-detections/histsignals"; + String localVarPath = "/api/v2/siem-historical-detections/jobs"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringHistsignals", + "v2.SecurityMonitoringApi.listHistoricalJobs", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -17985,56 +17227,50 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringHistsignals( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List hist signals. + * List historical jobs. * - *

See {@link #listSecurityMonitoringHistsignalsWithHttpInfo}. + *

See {@link #listHistoricalJobsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> + * @return CompletableFuture<ApiResponse<ListHistoricalJobsResponse>> */ - public CompletableFuture> - listSecurityMonitoringHistsignalsWithHttpInfoAsync( - ListSecurityMonitoringHistsignalsOptionalParameters parameters) { + public CompletableFuture> + listHistoricalJobsWithHttpInfoAsync(ListHistoricalJobsOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "listSecurityMonitoringHistsignals"; + String operationId = "listHistoricalJobs"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String sort = parameters.sort; String filterQuery = parameters.filterQuery; - OffsetDateTime filterFrom = parameters.filterFrom; - OffsetDateTime filterTo = parameters.filterTo; - SecurityMonitoringSignalsSort sort = parameters.sort; - String pageCursor = parameters.pageCursor; - Integer pageLimit = parameters.pageLimit; // create path and map variables - String localVarPath = "/api/v2/siem-historical-detections/histsignals"; + String localVarPath = "/api/v2/siem-historical-detections/jobs"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringHistsignals", + "v2.SecurityMonitoringApi.listHistoricalJobs", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -18042,8 +17278,7 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringHistsignals( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -18055,53 +17290,137 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringHistsignals( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listSecurityMonitoringIntegrationConfigs. */ - public static class ListSecurityMonitoringIntegrationConfigsOptionalParameters { - private SecurityMonitoringIntegrationType filterIntegrationType; + /** Manage optional parameters to listIndicatorsOfCompromise. */ + public static class ListIndicatorsOfCompromiseOptionalParameters { + private Integer limit; + private Integer offset; + private String query; + private String sortColumn; + private String sortOrder; + private Boolean ocsf; + private String workedBy; + private IoCTriageState triageState; /** - * Set filterIntegrationType. + * Set limit. * - * @param filterIntegrationType Filter the entity context sync configurations by source type. - * (optional) - * @return ListSecurityMonitoringIntegrationConfigsOptionalParameters + * @param limit Number of results per page. (optional, default to 50) + * @return ListIndicatorsOfCompromiseOptionalParameters */ - public ListSecurityMonitoringIntegrationConfigsOptionalParameters filterIntegrationType( - SecurityMonitoringIntegrationType filterIntegrationType) { - this.filterIntegrationType = filterIntegrationType; + public ListIndicatorsOfCompromiseOptionalParameters limit(Integer limit) { + this.limit = limit; return this; } - } - /** - * List entity context sync configurations. - * - *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfo}. - * - * @return SecurityMonitoringIntegrationConfigsResponse - * @throws ApiException if fails to make API call - */ - public SecurityMonitoringIntegrationConfigsResponse listSecurityMonitoringIntegrationConfigs() - throws ApiException { - return listSecurityMonitoringIntegrationConfigsWithHttpInfo( - new ListSecurityMonitoringIntegrationConfigsOptionalParameters()) - .getData(); - } + /** + * Set offset. + * + * @param offset Pagination offset. (optional, default to 0) + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters offset(Integer offset) { + this.offset = offset; + return this; + } - /** - * List entity context sync configurations. + /** + * Set query. + * + * @param query Search/filter query (supports field:value syntax). (optional) + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters query(String query) { + this.query = query; + return this; + } + + /** + * Set sortColumn. + * + * @param sortColumn Sort column: score, first_seen_ts_epoch, last_seen_ts_epoch, indicator, + * indicator_type, signal_count, log_count, category, as_type. (optional, default to + * "score") + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters sortColumn(String sortColumn) { + this.sortColumn = sortColumn; + return this; + } + + /** + * Set sortOrder. + * + * @param sortOrder Sort order: asc or desc. (optional, default to "desc") + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters sortOrder(String sortOrder) { + this.sortOrder = sortOrder; + return this; + } + + /** + * Set ocsf. + * + * @param ocsf When true, return only OCSF field-based matches. When false, return + * regex/message-based matches. (optional, default to true) + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters ocsf(Boolean ocsf) { + this.ocsf = ocsf; + return this; + } + + /** + * Set workedBy. + * + * @param workedBy Filter indicators whose triage state was updated by a specific user UUID. + * (optional) + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters workedBy(String workedBy) { + this.workedBy = workedBy; + return this; + } + + /** + * Set triageState. + * + * @param triageState Filter by triage state. (optional) + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters triageState(IoCTriageState triageState) { + this.triageState = triageState; + return this; + } + } + + /** + * List indicators of compromise. * - *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync}. + *

See {@link #listIndicatorsOfCompromiseWithHttpInfo}. * - * @return CompletableFuture<SecurityMonitoringIntegrationConfigsResponse> + * @return IoCExplorerListResponse + * @throws ApiException if fails to make API call */ - public CompletableFuture - listSecurityMonitoringIntegrationConfigsAsync() { - return listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync( - new ListSecurityMonitoringIntegrationConfigsOptionalParameters()) + public IoCExplorerListResponse listIndicatorsOfCompromise() throws ApiException { + return listIndicatorsOfCompromiseWithHttpInfo( + new ListIndicatorsOfCompromiseOptionalParameters()) + .getData(); + } + + /** + * List indicators of compromise. + * + *

See {@link #listIndicatorsOfCompromiseWithHttpInfoAsync}. + * + * @return CompletableFuture<IoCExplorerListResponse> + */ + public CompletableFuture listIndicatorsOfCompromiseAsync() { + return listIndicatorsOfCompromiseWithHttpInfoAsync( + new ListIndicatorsOfCompromiseOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -18109,31 +17428,30 @@ public SecurityMonitoringIntegrationConfigsResponse listSecurityMonitoringIntegr } /** - * List entity context sync configurations. + * List indicators of compromise. * - *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfo}. + *

See {@link #listIndicatorsOfCompromiseWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return SecurityMonitoringIntegrationConfigsResponse + * @return IoCExplorerListResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringIntegrationConfigsResponse listSecurityMonitoringIntegrationConfigs( - ListSecurityMonitoringIntegrationConfigsOptionalParameters parameters) throws ApiException { - return listSecurityMonitoringIntegrationConfigsWithHttpInfo(parameters).getData(); + public IoCExplorerListResponse listIndicatorsOfCompromise( + ListIndicatorsOfCompromiseOptionalParameters parameters) throws ApiException { + return listIndicatorsOfCompromiseWithHttpInfo(parameters).getData(); } /** - * List entity context sync configurations. + * List indicators of compromise. * - *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync}. + *

See {@link #listIndicatorsOfCompromiseWithHttpInfoAsync}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringIntegrationConfigsResponse> + * @return CompletableFuture<IoCExplorerListResponse> */ - public CompletableFuture - listSecurityMonitoringIntegrationConfigsAsync( - ListSecurityMonitoringIntegrationConfigsOptionalParameters parameters) { - return listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync(parameters) + public CompletableFuture listIndicatorsOfCompromiseAsync( + ListIndicatorsOfCompromiseOptionalParameters parameters) { + return listIndicatorsOfCompromiseWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -18141,47 +17459,57 @@ public SecurityMonitoringIntegrationConfigsResponse listSecurityMonitoringIntegr } /** - * List the entity context sync configurations for Cloud SIEM. Each configuration connects Cloud - * SIEM to an external source that provides entities (for example, users from an identity - * provider) for use in signals and the entity explorer. + * Get a list of indicators of compromise (IoCs) matching the specified filters. * * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringIntegrationConfigsResponse> + * @return ApiResponse<IoCExplorerListResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * + * * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
*/ - public ApiResponse - listSecurityMonitoringIntegrationConfigsWithHttpInfo( - ListSecurityMonitoringIntegrationConfigsOptionalParameters parameters) - throws ApiException { + public ApiResponse listIndicatorsOfCompromiseWithHttpInfo( + ListIndicatorsOfCompromiseOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "listSecurityMonitoringIntegrationConfigs"; + String operationId = "listIndicatorsOfCompromise"; 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; - SecurityMonitoringIntegrationType filterIntegrationType = parameters.filterIntegrationType; + Integer limit = parameters.limit; + Integer offset = parameters.offset; + String query = parameters.query; + String sortColumn = parameters.sortColumn; + String sortOrder = parameters.sortOrder; + Boolean ocsf = parameters.ocsf; + String workedBy = parameters.workedBy; + IoCTriageState triageState = parameters.triageState; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/integration_config"; + String localVarPath = "/api/v2/security/siem/ioc-explorer"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[integration_type]", filterIntegrationType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[column]", sortColumn)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[order]", sortOrder)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "ocsf", ocsf)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "worked_by", workedBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "triage_state", triageState)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringIntegrationConfigs", + "v2.SecurityMonitoringApi.listIndicatorsOfCompromise", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -18196,48 +17524,59 @@ public SecurityMonitoringIntegrationConfigsResponse listSecurityMonitoringIntegr localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List entity context sync configurations. + * List indicators of compromise. * - *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfo}. + *

See {@link #listIndicatorsOfCompromiseWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringIntegrationConfigsResponse>> + * @return CompletableFuture<ApiResponse<IoCExplorerListResponse>> */ - public CompletableFuture> - listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync( - ListSecurityMonitoringIntegrationConfigsOptionalParameters parameters) { + public CompletableFuture> + listIndicatorsOfCompromiseWithHttpInfoAsync( + ListIndicatorsOfCompromiseOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "listSecurityMonitoringIntegrationConfigs"; + String operationId = "listIndicatorsOfCompromise"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = null; - SecurityMonitoringIntegrationType filterIntegrationType = parameters.filterIntegrationType; + Integer limit = parameters.limit; + Integer offset = parameters.offset; + String query = parameters.query; + String sortColumn = parameters.sortColumn; + String sortOrder = parameters.sortOrder; + Boolean ocsf = parameters.ocsf; + String workedBy = parameters.workedBy; + IoCTriageState triageState = parameters.triageState; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/integration_config"; + String localVarPath = "/api/v2/security/siem/ioc-explorer"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[integration_type]", filterIntegrationType)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[column]", sortColumn)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[order]", sortOrder)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "ocsf", ocsf)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "worked_by", workedBy)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "triage_state", triageState)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringIntegrationConfigs", + "v2.SecurityMonitoringApi.listIndicatorsOfCompromise", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -18245,8 +17584,7 @@ public SecurityMonitoringIntegrationConfigsResponse listSecurityMonitoringIntegr new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -18258,337 +17596,237 @@ public SecurityMonitoringIntegrationConfigsResponse listSecurityMonitoringIntegr localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listSecurityMonitoringRules. */ - public static class ListSecurityMonitoringRulesOptionalParameters { - private Long pageSize; - private Long pageNumber; - private String query; - private SecurityMonitoringRuleSort sort; + /** + * Ruleset get multiple. + * + *

See {@link #listMultipleRulesetsWithHttpInfo}. + * + * @param body (required) + * @return GetMultipleRulesetsResponse + * @throws ApiException if fails to make API call + */ + public GetMultipleRulesetsResponse listMultipleRulesets(GetMultipleRulesetsRequest body) + throws ApiException { + return listMultipleRulesetsWithHttpInfo(body).getData(); + } - /** - * Set pageSize. - * - * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default - * to 10) - * @return ListSecurityMonitoringRulesOptionalParameters - */ - public ListSecurityMonitoringRulesOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; - return this; - } - - /** - * Set pageNumber. - * - * @param pageNumber Specific page number to return. (optional, default to 0) - * @return ListSecurityMonitoringRulesOptionalParameters - */ - public ListSecurityMonitoringRulesOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; - return this; - } - - /** - * Set query. - * - * @param query A search query to filter security rules. You can filter by attributes such as - * type, source, tags. (optional) - * @return ListSecurityMonitoringRulesOptionalParameters - */ - public ListSecurityMonitoringRulesOptionalParameters query(String query) { - this.query = query; - return this; - } - - /** - * Set sort. - * - * @param sort Attribute used to sort rules. Prefix with - to sort in descending - * order. (optional) - * @return ListSecurityMonitoringRulesOptionalParameters - */ - public ListSecurityMonitoringRulesOptionalParameters sort(SecurityMonitoringRuleSort sort) { - this.sort = sort; - return this; - } - } - - /** - * List rules. - * - *

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

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

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

See {@link #listSecurityMonitoringRulesWithHttpInfoAsync}. - * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringListRulesResponse> - */ - public CompletableFuture listSecurityMonitoringRulesAsync( - ListSecurityMonitoringRulesOptionalParameters parameters) { - return listSecurityMonitoringRulesWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); - } + /** + * Ruleset get multiple. + * + *

See {@link #listMultipleRulesetsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<GetMultipleRulesetsResponse> + */ + public CompletableFuture listMultipleRulesetsAsync( + GetMultipleRulesetsRequest body) { + return listMultipleRulesetsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } /** - * List rules. + * Get rules for multiple rulesets in batch. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringListRulesResponse> + * @param body (required) + * @return ApiResponse<GetMultipleRulesetsResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
*/ - public ApiResponse listSecurityMonitoringRulesWithHttpInfo( - ListSecurityMonitoringRulesOptionalParameters parameters) throws ApiException { - Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - String query = parameters.query; - SecurityMonitoringRuleSort sort = parameters.sort; + public ApiResponse listMultipleRulesetsWithHttpInfo( + GetMultipleRulesetsRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listMultipleRulesets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling listMultipleRulesets"); + } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules"; + String localVarPath = "/api/v2/static-analysis/rulesets"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringRules", + "v2.SecurityMonitoringApi.listMultipleRulesets", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List rules. + * Ruleset get multiple. * - *

See {@link #listSecurityMonitoringRulesWithHttpInfo}. + *

See {@link #listMultipleRulesetsWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SecurityMonitoringListRulesResponse>> + * @param body (required) + * @return CompletableFuture<ApiResponse<GetMultipleRulesetsResponse>> */ - public CompletableFuture> - listSecurityMonitoringRulesWithHttpInfoAsync( - ListSecurityMonitoringRulesOptionalParameters parameters) { - Object localVarPostBody = null; - Long pageSize = parameters.pageSize; - Long pageNumber = parameters.pageNumber; - String query = parameters.query; - SecurityMonitoringRuleSort sort = parameters.sort; + public CompletableFuture> + listMultipleRulesetsWithHttpInfoAsync(GetMultipleRulesetsRequest body) { + // Check if unstable operation is enabled + String operationId = "listMultipleRulesets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling listMultipleRulesets")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules"; + String localVarPath = "/api/v2/static-analysis/rulesets"; - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringRules", + "v2.SecurityMonitoringApi.listMultipleRulesets", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "GET", + "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listSecurityMonitoringSignals. */ - public static class ListSecurityMonitoringSignalsOptionalParameters { - private String filterQuery; - private OffsetDateTime filterFrom; - private OffsetDateTime filterTo; - private SecurityMonitoringSignalsSort sort; - private String pageCursor; - private Integer pageLimit; + /** Manage optional parameters to listSampleLogGenerationSubscriptions. */ + public static class ListSampleLogGenerationSubscriptionsOptionalParameters { + private SampleLogGenerationSubscriptionsStatusFilter status; + private OffsetDateTime startTimestamp; + private OffsetDateTime endTimestamp; /** - * Set filterQuery. + * Set status. * - * @param filterQuery The search query for security signals. (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters + * @param status Filter the subscriptions by status. Use active to return only + * currently active subscriptions, or all to return every subscription + * including expired ones. Ignored when start_timestamp is provided. Defaults + * to active. (optional, default to "active") + * @return ListSampleLogGenerationSubscriptionsOptionalParameters */ - public ListSecurityMonitoringSignalsOptionalParameters filterQuery(String filterQuery) { - this.filterQuery = filterQuery; + public ListSampleLogGenerationSubscriptionsOptionalParameters status( + SampleLogGenerationSubscriptionsStatusFilter status) { + this.status = status; return this; } /** - * Set filterFrom. + * Set startTimestamp. * - * @param filterFrom The minimum timestamp for requested security signals. (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters + * @param startTimestamp The start of the time range, as an RFC3339 timestamp. When provided, + * the response includes every subscription that was active at any point in + * [start_timestamp, end_timestamp], and the status filter is ignored. + * (optional) + * @return ListSampleLogGenerationSubscriptionsOptionalParameters */ - public ListSecurityMonitoringSignalsOptionalParameters filterFrom(OffsetDateTime filterFrom) { - this.filterFrom = filterFrom; + public ListSampleLogGenerationSubscriptionsOptionalParameters startTimestamp( + OffsetDateTime startTimestamp) { + this.startTimestamp = startTimestamp; return this; } /** - * Set filterTo. + * Set endTimestamp. * - * @param filterTo The maximum timestamp for requested security signals. (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters + * @param endTimestamp The end of the time range, as an RFC3339 timestamp. Ignored unless + * start_timestamp is set. Defaults to the current time when start_timestamp + * is provided. (optional) + * @return ListSampleLogGenerationSubscriptionsOptionalParameters */ - public ListSecurityMonitoringSignalsOptionalParameters filterTo(OffsetDateTime filterTo) { - this.filterTo = filterTo; - return this; - } - - /** - * Set sort. - * - * @param sort The order of the security signals in results. (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters - */ - public ListSecurityMonitoringSignalsOptionalParameters sort( - SecurityMonitoringSignalsSort sort) { - this.sort = sort; - return this; - } - - /** - * Set pageCursor. - * - * @param pageCursor A list of results using the cursor provided in the previous query. - * (optional) - * @return ListSecurityMonitoringSignalsOptionalParameters - */ - public ListSecurityMonitoringSignalsOptionalParameters pageCursor(String pageCursor) { - this.pageCursor = pageCursor; - return this; - } - - /** - * Set pageLimit. - * - * @param pageLimit The maximum number of security signals in the response. (optional, default - * to 10) - * @return ListSecurityMonitoringSignalsOptionalParameters - */ - public ListSecurityMonitoringSignalsOptionalParameters pageLimit(Integer pageLimit) { - this.pageLimit = pageLimit; + public ListSampleLogGenerationSubscriptionsOptionalParameters endTimestamp( + OffsetDateTime endTimestamp) { + this.endTimestamp = endTimestamp; return this; } } /** - * Get a quick list of security signals. + * Get sample log generation subscriptions. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfo}. * - * @return SecurityMonitoringSignalsListResponse + * @return SampleLogGenerationSubscriptionsResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals() throws ApiException { - return listSecurityMonitoringSignalsWithHttpInfo( - new ListSecurityMonitoringSignalsOptionalParameters()) + public SampleLogGenerationSubscriptionsResponse listSampleLogGenerationSubscriptions() + throws ApiException { + return listSampleLogGenerationSubscriptionsWithHttpInfo( + new ListSampleLogGenerationSubscriptionsOptionalParameters()) .getData(); } /** - * Get a quick list of security signals. + * Get sample log generation subscriptions. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfoAsync}. + *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfoAsync}. * - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + * @return CompletableFuture<SampleLogGenerationSubscriptionsResponse> */ - public CompletableFuture - listSecurityMonitoringSignalsAsync() { - return listSecurityMonitoringSignalsWithHttpInfoAsync( - new ListSecurityMonitoringSignalsOptionalParameters()) + public CompletableFuture + listSampleLogGenerationSubscriptionsAsync() { + return listSampleLogGenerationSubscriptionsWithHttpInfoAsync( + new ListSampleLogGenerationSubscriptionsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -18596,31 +17834,31 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals() thr } /** - * Get a quick list of security signals. + * Get sample log generation subscriptions. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return SecurityMonitoringSignalsListResponse + * @return SampleLogGenerationSubscriptionsResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals( - ListSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { - return listSecurityMonitoringSignalsWithHttpInfo(parameters).getData(); + public SampleLogGenerationSubscriptionsResponse listSampleLogGenerationSubscriptions( + ListSampleLogGenerationSubscriptionsOptionalParameters parameters) throws ApiException { + return listSampleLogGenerationSubscriptionsWithHttpInfo(parameters).getData(); } /** - * Get a quick list of security signals. + * Get sample log generation subscriptions. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfoAsync}. + *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfoAsync}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + * @return CompletableFuture<SampleLogGenerationSubscriptionsResponse> */ - public CompletableFuture - listSecurityMonitoringSignalsAsync( - ListSecurityMonitoringSignalsOptionalParameters parameters) { - return listSecurityMonitoringSignalsWithHttpInfoAsync(parameters) + public CompletableFuture + listSampleLogGenerationSubscriptionsAsync( + ListSampleLogGenerationSubscriptionsOptionalParameters parameters) { + return listSampleLogGenerationSubscriptionsWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -18628,67 +17866,17 @@ public SecurityMonitoringSignalsListResponse listSecurityMonitoringSignals( } /** - * Get a quick list of security signals. - * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. - * - * @return PaginationIterable<SecurityMonitoringSignal> - */ - public PaginationIterable - listSecurityMonitoringSignalsWithPagination() { - ListSecurityMonitoringSignalsOptionalParameters parameters = - new ListSecurityMonitoringSignalsOptionalParameters(); - return listSecurityMonitoringSignalsWithPagination(parameters); - } - - /** - * Get a quick list of security signals. - * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + * Get the sample log generation subscriptions for the organization. Sample log generation injects + * representative example logs for a given Cloud SIEM content pack into the Logs platform, which + * can be used to test detection rules without onboarding the underlying integration first. * - * @return SecurityMonitoringSignalsListResponse - */ - public PaginationIterable listSecurityMonitoringSignalsWithPagination( - ListSecurityMonitoringSignalsOptionalParameters parameters) { - String resultsPath = "getData"; - String valueGetterPath = "getMeta.getPage.getAfter"; - String valueSetterPath = "pageCursor"; - Boolean valueSetterParamOptional = true; - Integer limit; - - if (parameters.pageLimit == null) { - limit = 10; - parameters.pageLimit(limit); - } else { - limit = parameters.pageLimit; - } - - LinkedHashMap args = new LinkedHashMap(); - args.put("optionalParams", parameters); - - PaginationIterable iterator = - new PaginationIterable( - this, - "listSecurityMonitoringSignals", - resultsPath, - valueGetterPath, - valueSetterPath, - valueSetterParamOptional, - true, - true, - limit, - args, - 0); - - return iterator; - } - - /** - * The list endpoint returns security signals that match a search query. Both this endpoint and - * the POST endpoint can be used interchangeably when listing security signals. + *

Availability: this endpoint is restricted to Cloud SIEM trial organizations + * on an eligible pricing model. Other organizations receive a 403 Forbidden + * (non-trial orgs) or a 400 Bad Request (feature disabled), and legacy pricing tiers + * receive a response with status: not_available. * * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringSignalsListResponse> + * @return ApiResponse<SampleLogGenerationSubscriptionsResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -18700,32 +17888,33 @@ public PaginationIterable listSecurityMonitoringSignal * *
429 Too many requests -
*/ - public ApiResponse - listSecurityMonitoringSignalsWithHttpInfo( - ListSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { + public ApiResponse + listSampleLogGenerationSubscriptionsWithHttpInfo( + ListSampleLogGenerationSubscriptionsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listSampleLogGenerationSubscriptions"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = null; - String filterQuery = parameters.filterQuery; - OffsetDateTime filterFrom = parameters.filterFrom; - OffsetDateTime filterTo = parameters.filterTo; - SecurityMonitoringSignalsSort sort = parameters.sort; - String pageCursor = parameters.pageCursor; - Integer pageLimit = parameters.pageLimit; + SampleLogGenerationSubscriptionsStatusFilter status = parameters.status; + OffsetDateTime startTimestamp = parameters.startTimestamp; + OffsetDateTime endTimestamp = parameters.endTimestamp; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/signals"; + String localVarPath = "/api/v2/security_monitoring/sample_log_generation/subscriptions"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_timestamp", startTimestamp)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_timestamp", endTimestamp)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringSignals", + "v2.SecurityMonitoringApi.listSampleLogGenerationSubscriptions", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -18740,45 +17929,50 @@ public PaginationIterable listSecurityMonitoringSignal localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a quick list of security signals. + * Get sample log generation subscriptions. * - *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #listSampleLogGenerationSubscriptionsWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> + * @return CompletableFuture<ApiResponse<SampleLogGenerationSubscriptionsResponse>> */ - public CompletableFuture> - listSecurityMonitoringSignalsWithHttpInfoAsync( - ListSecurityMonitoringSignalsOptionalParameters parameters) { + public CompletableFuture> + listSampleLogGenerationSubscriptionsWithHttpInfoAsync( + ListSampleLogGenerationSubscriptionsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listSampleLogGenerationSubscriptions"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - String filterQuery = parameters.filterQuery; - OffsetDateTime filterFrom = parameters.filterFrom; - OffsetDateTime filterTo = parameters.filterTo; - SecurityMonitoringSignalsSort sort = parameters.sort; - String pageCursor = parameters.pageCursor; - Integer pageLimit = parameters.pageLimit; + SampleLogGenerationSubscriptionsStatusFilter status = parameters.status; + OffsetDateTime startTimestamp = parameters.startTimestamp; + OffsetDateTime endTimestamp = parameters.endTimestamp; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/signals"; + String localVarPath = "/api/v2/security_monitoring/sample_log_generation/subscriptions"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "status", status)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "start_timestamp", startTimestamp)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "end_timestamp", endTimestamp)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringSignals", + "v2.SecurityMonitoringApi.listSampleLogGenerationSubscriptions", localVarPath, localVarQueryParams, localVarHeaderParams, @@ -18786,7 +17980,7 @@ public PaginationIterable listSecurityMonitoringSignal new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -18799,90 +17993,113 @@ public PaginationIterable listSecurityMonitoringSignal localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listSecurityMonitoringSuppressions. */ - public static class ListSecurityMonitoringSuppressionsOptionalParameters { - private String query; - private SecurityMonitoringSuppressionSort sort; - private Long pageSize; + /** Manage optional parameters to listScannedAssetsMetadata. */ + public static class ListScannedAssetsMetadataOptionalParameters { + private String pageToken; private Long pageNumber; + private CloudAssetType filterAssetType; + private String filterAssetName; + private String filterLastSuccessOrigin; + private String filterLastSuccessEnv; /** - * Set query. + * Set pageToken. * - * @param query Query string. (optional) - * @return ListSecurityMonitoringSuppressionsOptionalParameters + * @param pageToken Its value must come from the links section of the response of + * the first request. Do not manually edit it. (optional) + * @return ListScannedAssetsMetadataOptionalParameters */ - public ListSecurityMonitoringSuppressionsOptionalParameters query(String query) { - this.query = query; + public ListScannedAssetsMetadataOptionalParameters pageToken(String pageToken) { + this.pageToken = pageToken; return this; } /** - * Set sort. + * Set pageNumber. * - * @param sort Attribute used to sort the list of suppression rules. Prefix with - - * to sort in descending order. (optional) - * @return ListSecurityMonitoringSuppressionsOptionalParameters + * @param pageNumber The page number to be retrieved. It should be equal to or greater than 1. + * (optional) + * @return ListScannedAssetsMetadataOptionalParameters */ - public ListSecurityMonitoringSuppressionsOptionalParameters sort( - SecurityMonitoringSuppressionSort sort) { - this.sort = sort; + public ListScannedAssetsMetadataOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; return this; } /** - * Set pageSize. + * Set filterAssetType. * - * @param pageSize Size for a given page. Use -1 to return all items. (optional, - * default to -1) - * @return ListSecurityMonitoringSuppressionsOptionalParameters + * @param filterAssetType The type of the scanned asset. (optional) + * @return ListScannedAssetsMetadataOptionalParameters */ - public ListSecurityMonitoringSuppressionsOptionalParameters pageSize(Long pageSize) { - this.pageSize = pageSize; + public ListScannedAssetsMetadataOptionalParameters filterAssetType( + CloudAssetType filterAssetType) { + this.filterAssetType = filterAssetType; return this; } /** - * Set pageNumber. + * Set filterAssetName. * - * @param pageNumber Specific page number to return. (optional, default to 0) - * @return ListSecurityMonitoringSuppressionsOptionalParameters + * @param filterAssetName The name of the scanned asset. (optional) + * @return ListScannedAssetsMetadataOptionalParameters */ - public ListSecurityMonitoringSuppressionsOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; + public ListScannedAssetsMetadataOptionalParameters filterAssetName(String filterAssetName) { + this.filterAssetName = filterAssetName; + return this; + } + + /** + * Set filterLastSuccessOrigin. + * + * @param filterLastSuccessOrigin The origin of last success scan. (optional) + * @return ListScannedAssetsMetadataOptionalParameters + */ + public ListScannedAssetsMetadataOptionalParameters filterLastSuccessOrigin( + String filterLastSuccessOrigin) { + this.filterLastSuccessOrigin = filterLastSuccessOrigin; + return this; + } + + /** + * Set filterLastSuccessEnv. + * + * @param filterLastSuccessEnv The environment of last success scan. (optional) + * @return ListScannedAssetsMetadataOptionalParameters + */ + public ListScannedAssetsMetadataOptionalParameters filterLastSuccessEnv( + String filterLastSuccessEnv) { + this.filterLastSuccessEnv = filterLastSuccessEnv; return this; } } /** - * Get all suppression rules. + * List scanned assets metadata. * - *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfo}. + *

See {@link #listScannedAssetsMetadataWithHttpInfo}. * - * @return SecurityMonitoringPaginatedSuppressionsResponse + * @return ScannedAssetsMetadata * @throws ApiException if fails to make API call */ - public SecurityMonitoringPaginatedSuppressionsResponse listSecurityMonitoringSuppressions() - throws ApiException { - return listSecurityMonitoringSuppressionsWithHttpInfo( - new ListSecurityMonitoringSuppressionsOptionalParameters()) + public ScannedAssetsMetadata listScannedAssetsMetadata() throws ApiException { + return listScannedAssetsMetadataWithHttpInfo(new ListScannedAssetsMetadataOptionalParameters()) .getData(); } /** - * Get all suppression rules. + * List scanned assets metadata. * - *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfoAsync}. + *

See {@link #listScannedAssetsMetadataWithHttpInfoAsync}. * - * @return CompletableFuture<SecurityMonitoringPaginatedSuppressionsResponse> + * @return CompletableFuture<ScannedAssetsMetadata> */ - public CompletableFuture - listSecurityMonitoringSuppressionsAsync() { - return listSecurityMonitoringSuppressionsWithHttpInfoAsync( - new ListSecurityMonitoringSuppressionsOptionalParameters()) + public CompletableFuture listScannedAssetsMetadataAsync() { + return listScannedAssetsMetadataWithHttpInfoAsync( + new ListScannedAssetsMetadataOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -18890,31 +18107,30 @@ public SecurityMonitoringPaginatedSuppressionsResponse listSecurityMonitoringSup } /** - * Get all suppression rules. + * List scanned assets metadata. * - *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfo}. + *

See {@link #listScannedAssetsMetadataWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return SecurityMonitoringPaginatedSuppressionsResponse + * @return ScannedAssetsMetadata * @throws ApiException if fails to make API call */ - public SecurityMonitoringPaginatedSuppressionsResponse listSecurityMonitoringSuppressions( - ListSecurityMonitoringSuppressionsOptionalParameters parameters) throws ApiException { - return listSecurityMonitoringSuppressionsWithHttpInfo(parameters).getData(); + public ScannedAssetsMetadata listScannedAssetsMetadata( + ListScannedAssetsMetadataOptionalParameters parameters) throws ApiException { + return listScannedAssetsMetadataWithHttpInfo(parameters).getData(); } /** - * Get all suppression rules. + * List scanned assets metadata. * - *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfoAsync}. + *

See {@link #listScannedAssetsMetadataWithHttpInfoAsync}. * * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringPaginatedSuppressionsResponse> + * @return CompletableFuture<ScannedAssetsMetadata> */ - public CompletableFuture - listSecurityMonitoringSuppressionsAsync( - ListSecurityMonitoringSuppressionsOptionalParameters parameters) { - return listSecurityMonitoringSuppressionsWithHttpInfoAsync(parameters) + public CompletableFuture listScannedAssetsMetadataAsync( + ListScannedAssetsMetadataOptionalParameters parameters) { + return listScannedAssetsMetadataWithHttpInfoAsync(parameters) .thenApply( response -> { return response.getData(); @@ -18922,48 +18138,115 @@ public SecurityMonitoringPaginatedSuppressionsResponse listSecurityMonitoringSup } /** - * Get the list of all suppression rules. + * Get a list of security scanned assets metadata for an organization. + * + *

Pagination

+ * + *

For the "List Vulnerabilities" endpoint, see the Pagination + * section. + * + *

Filtering

+ * + *

For the "List Vulnerabilities" endpoint, see the Filtering section. + * + *

Metadata

+ * + *

For the "List Vulnerabilities" endpoint, see the Metadata section. + * + *

Related endpoints

+ * + *

This endpoint returns additional metadata for cloud resources that is not available from the + * standard resource endpoints. To access a richer dataset, call this endpoint together with the + * relevant resource endpoint(s) and merge (join) their results using the resource identifier. + * + *

Hosts + * + *

To enrich host data, join the response from the Hosts endpoint with the response from + * the scanned-assets-metadata endpoint on the following key fields: + * + *

| ENDPOINT | JOIN KEY | TYPE | | --- | --- | --- | | /api/v1/hosts | host_list.host_name | + * string | | /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | + * + *

Host Images + * + *

To enrich host image data, join the response from the Hosts endpoint with the response from + * the scanned-assets-metadata endpoint on the following key fields: + * + *

| ENDPOINT | JOIN KEY | TYPE | | --- | --- | --- | | /api/v1/hosts | + * host_list.tags_by_source["Amazon Web Services"]["image"] | string | | + * /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | + * + *

Container Images + * + *

To enrich container image data, join the response from the Container Images endpoint + * with the response from the scanned-assets-metadata endpoint on the following key fields: + * + *

| ENDPOINT | JOIN KEY | TYPE | | --- | --- | --- | | /api/v2/container_images | + * data.attributes.name@data.attributes.repo_digest | string | | + * /api/v2/security/scanned-assets-metadata | data.attributes.asset.name | string | * * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringPaginatedSuppressionsResponse> + * @return ApiResponse<ScannedAssetsMetadata> * @throws ApiException if fails to make API call * @http.response.details * * * * - * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: asset not found -
429 Too many requests -
*/ - public ApiResponse - listSecurityMonitoringSuppressionsWithHttpInfo( - ListSecurityMonitoringSuppressionsOptionalParameters parameters) throws ApiException { + public ApiResponse listScannedAssetsMetadataWithHttpInfo( + ListScannedAssetsMetadataOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listScannedAssetsMetadata"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = null; - String query = parameters.query; - SecurityMonitoringSuppressionSort sort = parameters.sort; - Long pageSize = parameters.pageSize; + String pageToken = parameters.pageToken; Long pageNumber = parameters.pageNumber; + CloudAssetType filterAssetType = parameters.filterAssetType; + String filterAssetName = parameters.filterAssetName; + String filterLastSuccessOrigin = parameters.filterLastSuccessOrigin; + String filterLastSuccessEnv = parameters.filterLastSuccessEnv; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; + String localVarPath = "/api/v2/security/scanned-assets-metadata"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.type]", filterAssetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[last_success.origin]", filterLastSuccessOrigin)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[last_success.env]", filterLastSuccessEnv)); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringSuppressions", + "v2.SecurityMonitoringApi.listScannedAssetsMetadata", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "GET", builder, @@ -18972,51 +18255,67 @@ public SecurityMonitoringPaginatedSuppressionsResponse listSecurityMonitoringSup localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get all suppression rules. + * List scanned assets metadata. * - *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfo}. + *

See {@link #listScannedAssetsMetadataWithHttpInfo}. * * @param parameters Optional parameters for the request. - * @return - * CompletableFuture<ApiResponse<SecurityMonitoringPaginatedSuppressionsResponse>> + * @return CompletableFuture<ApiResponse<ScannedAssetsMetadata>> */ - public CompletableFuture> - listSecurityMonitoringSuppressionsWithHttpInfoAsync( - ListSecurityMonitoringSuppressionsOptionalParameters parameters) { + public CompletableFuture> + listScannedAssetsMetadataWithHttpInfoAsync( + ListScannedAssetsMetadataOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listScannedAssetsMetadata"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = null; - String query = parameters.query; - SecurityMonitoringSuppressionSort sort = parameters.sort; - Long pageSize = parameters.pageSize; + String pageToken = parameters.pageToken; Long pageNumber = parameters.pageNumber; + CloudAssetType filterAssetType = parameters.filterAssetType; + String filterAssetName = parameters.filterAssetName; + String filterLastSuccessOrigin = parameters.filterLastSuccessOrigin; + String filterLastSuccessEnv = parameters.filterLastSuccessEnv; // create path and map variables - String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; + String localVarPath = "/api/v2/security/scanned-assets-metadata"; List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.type]", filterAssetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[last_success.origin]", filterLastSuccessOrigin)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[last_success.env]", filterLastSuccessEnv)); Invocation.Builder builder; try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listSecurityMonitoringSuppressions", + "v2.SecurityMonitoringApi.listScannedAssetsMetadata", localVarPath, localVarQueryParams, localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -19028,30 +18327,30 @@ public SecurityMonitoringPaginatedSuppressionsResponse listSecurityMonitoringSup localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List codegen rulesets. + * Get all security filters. * - *

See {@link #listStaticAnalysisCodegenRulesetsWithHttpInfo}. + *

See {@link #listSecurityFiltersWithHttpInfo}. * - * @return SastRulesetsResponse + * @return SecurityFiltersResponse * @throws ApiException if fails to make API call */ - public SastRulesetsResponse listStaticAnalysisCodegenRulesets() throws ApiException { - return listStaticAnalysisCodegenRulesetsWithHttpInfo().getData(); + public SecurityFiltersResponse listSecurityFilters() throws ApiException { + return listSecurityFiltersWithHttpInfo().getData(); } /** - * List codegen rulesets. + * Get all security filters. * - *

See {@link #listStaticAnalysisCodegenRulesetsWithHttpInfoAsync}. + *

See {@link #listSecurityFiltersWithHttpInfoAsync}. * - * @return CompletableFuture<SastRulesetsResponse> + * @return CompletableFuture<SecurityFiltersResponse> */ - public CompletableFuture listStaticAnalysisCodegenRulesetsAsync() { - return listStaticAnalysisCodegenRulesetsWithHttpInfoAsync() + public CompletableFuture listSecurityFiltersAsync() { + return listSecurityFiltersWithHttpInfoAsync() .thenApply( response -> { return response.getData(); @@ -19059,38 +18358,30 @@ public CompletableFuture listStaticAnalysisCodegenRulesets } /** - * Get the rulesets relevant for code generation for the authenticated user. + * Get the list of configured security filters with their definitions. * - * @return ApiResponse<SastRulesetsResponse> + * @return ApiResponse<SecurityFiltersResponse> * @throws ApiException if fails to make API call * @http.response.details * * * * - * - * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Not Authorized -
429 Too many requests -
*/ - public ApiResponse listStaticAnalysisCodegenRulesetsWithHttpInfo() + public ApiResponse listSecurityFiltersWithHttpInfo() throws ApiException { - // Check if unstable operation is enabled - String operationId = "listStaticAnalysisCodegenRulesets"; - 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; // create path and map variables - String localVarPath = "/api/v2/static-analysis/codegen/rulesets"; + String localVarPath = "/api/v2/security_monitoring/configuration/security_filters"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listStaticAnalysisCodegenRulesets", + "v2.SecurityMonitoringApi.listSecurityFilters", localVarPath, new ArrayList(), localVarHeaderParams, @@ -19105,31 +18396,134 @@ public ApiResponse listStaticAnalysisCodegenRulesetsWithHt localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List codegen rulesets. + * Get all security filters. * - *

See {@link #listStaticAnalysisCodegenRulesetsWithHttpInfo}. + *

See {@link #listSecurityFiltersWithHttpInfo}. * - * @return CompletableFuture<ApiResponse<SastRulesetsResponse>> + * @return CompletableFuture<ApiResponse<SecurityFiltersResponse>> */ - public CompletableFuture> - listStaticAnalysisCodegenRulesetsWithHttpInfoAsync() { - // Check if unstable operation is enabled - String operationId = "listStaticAnalysisCodegenRulesets"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + public CompletableFuture> + listSecurityFiltersWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/security_filters"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFilters", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); return result; } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the version history of security filters. + * + *

See {@link #listSecurityFilterVersionsWithHttpInfo}. + * + * @return SecurityFilterVersionsResponse + * @throws ApiException if fails to make API call + */ + public SecurityFilterVersionsResponse listSecurityFilterVersions() throws ApiException { + return listSecurityFilterVersionsWithHttpInfo().getData(); + } + + /** + * Get the version history of security filters. + * + *

See {@link #listSecurityFilterVersionsWithHttpInfoAsync}. + * + * @return CompletableFuture<SecurityFilterVersionsResponse> + */ + public CompletableFuture listSecurityFilterVersionsAsync() { + return listSecurityFilterVersionsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the configured security filters at each historical version of the configuration. Each entry + * in the response represents the set of all security filters at a given version, ordered from the + * most recent version to the oldest. + * + * @return ApiResponse<SecurityFilterVersionsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse listSecurityFilterVersionsWithHttpInfo() + throws ApiException { Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api/v2/static-analysis/codegen/rulesets"; + String localVarPath = "/api/v2/security_monitoring/configuration/security_filters/versions"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFilterVersions", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get the version history of security filters. + * + *

See {@link #listSecurityFilterVersionsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<SecurityFilterVersionsResponse>> + */ + public CompletableFuture> + listSecurityFilterVersionsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/security_filters/versions"; Map localVarHeaderParams = new HashMap(); @@ -19137,7 +18531,7 @@ public ApiResponse listStaticAnalysisCodegenRulesetsWithHt try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listStaticAnalysisCodegenRulesets", + "v2.SecurityMonitoringApi.listSecurityFilterVersions", localVarPath, new ArrayList(), localVarHeaderParams, @@ -19145,7 +18539,8 @@ public ApiResponse listStaticAnalysisCodegenRulesetsWithHt new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -19157,630 +18552,4629 @@ public ApiResponse listStaticAnalysisCodegenRulesetsWithHt localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } - /** Manage optional parameters to listVulnerabilities. */ - public static class ListVulnerabilitiesOptionalParameters { - private String pageToken; - private Long pageNumber; - private VulnerabilityType filterType; - private Double filterCvssBaseScoreOp; - private VulnerabilitySeverity filterCvssBaseSeverity; - private String filterCvssBaseVector; - private Double filterCvssDatadogScoreOp; - private VulnerabilitySeverity filterCvssDatadogSeverity; - private String filterCvssDatadogVector; - private VulnerabilityStatus filterStatus; - private VulnerabilityTool filterTool; - private String filterLibraryName; - private String filterLibraryVersion; - private String filterAdvisoryId; - private Boolean filterRisksExploitationProbability; - private Boolean filterRisksPocExploitAvailable; - private Boolean filterRisksExploitAvailable; - private Double filterRisksEpssScoreOp; - private VulnerabilitySeverity filterRisksEpssSeverity; - private String filterLanguage; - private VulnerabilityEcosystem filterEcosystem; - private String filterCodeLocationLocation; - private String filterCodeLocationFilePath; - private String filterCodeLocationMethod; - private Boolean filterFixAvailable; - private String filterRepoDigests; - private String filterOrigin; - private Boolean filterRunningKernel; - private String filterAssetName; - private AssetType filterAssetType; - private String filterAssetVersionFirst; - private String filterAssetVersionLast; - private String filterAssetRepositoryUrl; - private Boolean filterAssetRisksInProduction; - private Boolean filterAssetRisksUnderAttack; - private Boolean filterAssetRisksIsPubliclyAccessible; - private Boolean filterAssetRisksHasPrivilegedAccess; - private Boolean filterAssetRisksHasAccessToSensitiveData; - private String filterAssetEnvironments; - private String filterAssetTeams; - private String filterAssetArch; - private String filterAssetOperatingSystemName; - private String filterAssetOperatingSystemVersion; + /** Manage optional parameters to listSecurityFindings. */ + public static class ListSecurityFindingsOptionalParameters { + private String filterQuery; + private String pageCursor; + private Long pageLimit; + private SecurityFindingsSort sort; /** - * Set pageToken. + * Set filterQuery. * - * @param pageToken Its value must come from the links section of the response of - * the first request. Do not manually edit it. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param filterQuery The search query following log search syntax. (optional, default to "*") + * @return ListSecurityFindingsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters pageToken(String pageToken) { - this.pageToken = pageToken; - return this; - } - - /** - * Set pageNumber. - * - * @param pageNumber The page number to be retrieved. It should be equal or greater than 1 - * (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters pageNumber(Long pageNumber) { - this.pageNumber = pageNumber; + public ListSecurityFindingsOptionalParameters filterQuery(String filterQuery) { + this.filterQuery = filterQuery; return this; } /** - * Set filterType. + * Set pageCursor. * - * @param filterType Filter by vulnerability type. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageCursor Get the next page of results with a cursor provided in the previous query. + * (optional) + * @return ListSecurityFindingsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterType(VulnerabilityType filterType) { - this.filterType = filterType; + public ListSecurityFindingsOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; return this; } /** - * Set filterCvssBaseScoreOp. + * Set pageLimit. * - * @param filterCvssBaseScoreOp Filter by vulnerability base (i.e. from the original advisory) - * severity score. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageLimit The maximum number of findings in the response. (optional, default to 10) + * @return ListSecurityFindingsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterCvssBaseScoreOp( - Double filterCvssBaseScoreOp) { - this.filterCvssBaseScoreOp = filterCvssBaseScoreOp; + public ListSecurityFindingsOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; return this; } /** - * Set filterCvssBaseSeverity. + * Set sort. * - * @param filterCvssBaseSeverity Filter by vulnerability base severity. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param sort Sorts by @detection_changed_at. (optional, default to "-@detection_changed_at") + * @return ListSecurityFindingsOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterCvssBaseSeverity( - VulnerabilitySeverity filterCvssBaseSeverity) { - this.filterCvssBaseSeverity = filterCvssBaseSeverity; + public ListSecurityFindingsOptionalParameters sort(SecurityFindingsSort sort) { + this.sort = sort; return this; } + } - /** - * Set filterCvssBaseVector. - * - * @param filterCvssBaseVector Filter by vulnerability base CVSS vector. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssBaseVector(String filterCvssBaseVector) { - this.filterCvssBaseVector = filterCvssBaseVector; - return this; - } + /** + * List security findings. + * + *

See {@link #listSecurityFindingsWithHttpInfo}. + * + * @return ListSecurityFindingsResponse + * @throws ApiException if fails to make API call + */ + public ListSecurityFindingsResponse listSecurityFindings() throws ApiException { + return listSecurityFindingsWithHttpInfo(new ListSecurityFindingsOptionalParameters()).getData(); + } - /** - * Set filterCvssDatadogScoreOp. - * - * @param filterCvssDatadogScoreOp Filter by vulnerability Datadog severity score. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssDatadogScoreOp( - Double filterCvssDatadogScoreOp) { - this.filterCvssDatadogScoreOp = filterCvssDatadogScoreOp; - return this; - } + /** + * List security findings. + * + *

See {@link #listSecurityFindingsWithHttpInfoAsync}. + * + * @return CompletableFuture<ListSecurityFindingsResponse> + */ + public CompletableFuture listSecurityFindingsAsync() { + return listSecurityFindingsWithHttpInfoAsync(new ListSecurityFindingsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } - /** - * Set filterCvssDatadogSeverity. - * - * @param filterCvssDatadogSeverity Filter by vulnerability Datadog severity. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssDatadogSeverity( - VulnerabilitySeverity filterCvssDatadogSeverity) { - this.filterCvssDatadogSeverity = filterCvssDatadogSeverity; - return this; - } + /** + * List security findings. + * + *

See {@link #listSecurityFindingsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ListSecurityFindingsResponse + * @throws ApiException if fails to make API call + */ + public ListSecurityFindingsResponse listSecurityFindings( + ListSecurityFindingsOptionalParameters parameters) throws ApiException { + return listSecurityFindingsWithHttpInfo(parameters).getData(); + } - /** - * Set filterCvssDatadogVector. - * - * @param filterCvssDatadogVector Filter by vulnerability Datadog CVSS vector. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCvssDatadogVector( - String filterCvssDatadogVector) { - this.filterCvssDatadogVector = filterCvssDatadogVector; - return this; - } + /** + * List security findings. + * + *

See {@link #listSecurityFindingsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListSecurityFindingsResponse> + */ + public CompletableFuture listSecurityFindingsAsync( + ListSecurityFindingsOptionalParameters parameters) { + return listSecurityFindingsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } - /** - * Set filterStatus. - * - * @param filterStatus Filter by the status of the vulnerability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterStatus(VulnerabilityStatus filterStatus) { - this.filterStatus = filterStatus; - return this; - } + /** + * List security findings. + * + *

See {@link #listSecurityFindingsWithHttpInfo}. + * + * @return PaginationIterable<SecurityFindingsData> + */ + public PaginationIterable listSecurityFindingsWithPagination() { + ListSecurityFindingsOptionalParameters parameters = + new ListSecurityFindingsOptionalParameters(); + return listSecurityFindingsWithPagination(parameters); + } - /** - * Set filterTool. - * - * @param filterTool Filter by the tool of the vulnerability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterTool(VulnerabilityTool filterTool) { - this.filterTool = filterTool; - return this; - } + /** + * List security findings. + * + *

See {@link #listSecurityFindingsWithHttpInfo}. + * + * @return ListSecurityFindingsResponse + */ + public PaginationIterable listSecurityFindingsWithPagination( + ListSecurityFindingsOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = "getMeta.getPage.getAfter"; + String valueSetterPath = "pageCursor"; + Boolean valueSetterParamOptional = true; + Long limit; - /** - * Set filterLibraryName. - * - * @param filterLibraryName Filter by library name. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterLibraryName(String filterLibraryName) { - this.filterLibraryName = filterLibraryName; - return this; + if (parameters.pageLimit == null) { + limit = 10l; + parameters.pageLimit(limit); + } else { + limit = parameters.pageLimit; } - /** - * Set filterLibraryVersion. - * - * @param filterLibraryVersion Filter by library version. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterLibraryVersion(String filterLibraryVersion) { - this.filterLibraryVersion = filterLibraryVersion; - return this; - } + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); - /** - * Set filterAdvisoryId. - * - * @param filterAdvisoryId Filter by advisory ID. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAdvisoryId(String filterAdvisoryId) { - this.filterAdvisoryId = filterAdvisoryId; - return this; - } + PaginationIterable iterator = + new PaginationIterable( + this, + "listSecurityFindings", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + true, + limit, + args, + 0); - /** - * Set filterRisksExploitationProbability. - * - * @param filterRisksExploitationProbability Filter by exploitation probability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksExploitationProbability( - Boolean filterRisksExploitationProbability) { - this.filterRisksExploitationProbability = filterRisksExploitationProbability; - return this; - } + return iterator; + } - /** - * Set filterRisksPocExploitAvailable. - * - * @param filterRisksPocExploitAvailable Filter by POC exploit availability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksPocExploitAvailable( - Boolean filterRisksPocExploitAvailable) { - this.filterRisksPocExploitAvailable = filterRisksPocExploitAvailable; - return this; - } - - /** - * Set filterRisksExploitAvailable. - * - * @param filterRisksExploitAvailable Filter by public exploit availability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksExploitAvailable( - Boolean filterRisksExploitAvailable) { - this.filterRisksExploitAvailable = filterRisksExploitAvailable; - return this; - } + /** + * Get a list of security findings that match a search query. See the schema for security + * findings. + * + *

Query Syntax

+ * + *

This endpoint uses the logs query syntax. Findings attributes (living in the + * attributes.attributes. namespace) are prefixed by @ when queried. Tags are queried without a + * prefix. + * + *

Example: @severity:(critical OR high) @status:open team:platform + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListSecurityFindingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listSecurityFindingsWithHttpInfo( + ListSecurityFindingsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + String filterQuery = parameters.filterQuery; + String pageCursor = parameters.pageCursor; + Long pageLimit = parameters.pageLimit; + SecurityFindingsSort sort = parameters.sort; + // create path and map variables + String localVarPath = "/api/v2/security/findings"; - /** - * Set filterRisksEpssScoreOp. - * - * @param filterRisksEpssScoreOp Filter by vulnerability EPSS severity score. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksEpssScoreOp( - Double filterRisksEpssScoreOp) { - this.filterRisksEpssScoreOp = filterRisksEpssScoreOp; - return this; - } + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); - /** - * Set filterRisksEpssSeverity. - * - * @param filterRisksEpssSeverity Filter by vulnerability EPSS severity. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRisksEpssSeverity( - VulnerabilitySeverity filterRisksEpssSeverity) { - this.filterRisksEpssSeverity = filterRisksEpssSeverity; - return this; - } + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - /** - * Set filterLanguage. - * - * @param filterLanguage Filter by language. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterLanguage(String filterLanguage) { - this.filterLanguage = filterLanguage; - return this; - } + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFindings", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } - /** - * Set filterEcosystem. - * - * @param filterEcosystem Filter by ecosystem. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterEcosystem( - VulnerabilityEcosystem filterEcosystem) { - this.filterEcosystem = filterEcosystem; - return this; - } + /** + * List security findings. + * + *

See {@link #listSecurityFindingsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListSecurityFindingsResponse>> + */ + public CompletableFuture> + listSecurityFindingsWithHttpInfoAsync(ListSecurityFindingsOptionalParameters parameters) { + Object localVarPostBody = null; + String filterQuery = parameters.filterQuery; + String pageCursor = parameters.pageCursor; + Long pageLimit = parameters.pageLimit; + SecurityFindingsSort sort = parameters.sort; + // create path and map variables + String localVarPath = "/api/v2/security/findings"; - /** - * Set filterCodeLocationLocation. - * - * @param filterCodeLocationLocation Filter by vulnerability location. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCodeLocationLocation( - String filterCodeLocationLocation) { - this.filterCodeLocationLocation = filterCodeLocationLocation; - return this; - } + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); - /** - * Set filterCodeLocationFilePath. - * - * @param filterCodeLocationFilePath Filter by vulnerability file path. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCodeLocationFilePath( - String filterCodeLocationFilePath) { - this.filterCodeLocationFilePath = filterCodeLocationFilePath; - return this; - } + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); - /** - * Set filterCodeLocationMethod. - * - * @param filterCodeLocationMethod Filter by method. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterCodeLocationMethod( - String filterCodeLocationMethod) { - this.filterCodeLocationMethod = filterCodeLocationMethod; - return this; + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFindings", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } - /** - * Set filterFixAvailable. - * - * @param filterFixAvailable Filter by fix availability. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterFixAvailable(Boolean filterFixAvailable) { - this.filterFixAvailable = filterFixAvailable; - return this; - } + /** Manage optional parameters to listSecurityFindingsAutomationDueDateRules. */ + public static class ListSecurityFindingsAutomationDueDateRulesOptionalParameters { + private Long pageSize; + private Long pageNumber; /** - * Set filterRepoDigests. + * Set pageSize. * - * @param filterRepoDigests Filter by vulnerability repo_digest (when the - * vulnerability is related to Image asset). (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageSize The number of rules per page. Maximum is 1000. (optional, default to 1000) + * @return ListSecurityFindingsAutomationDueDateRulesOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterRepoDigests(String filterRepoDigests) { - this.filterRepoDigests = filterRepoDigests; + public ListSecurityFindingsAutomationDueDateRulesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; return this; } /** - * Set filterOrigin. + * Set pageNumber. * - * @param filterOrigin Filter by origin. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageNumber The page number to return. (optional, default to 0) + * @return ListSecurityFindingsAutomationDueDateRulesOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterOrigin(String filterOrigin) { - this.filterOrigin = filterOrigin; + public ListSecurityFindingsAutomationDueDateRulesOptionalParameters pageNumber( + Long pageNumber) { + this.pageNumber = pageNumber; return this; } + } - /** - * Set filterRunningKernel. - * - * @param filterRunningKernel Filter for whether the vulnerability affects a running kernel (for - * vulnerabilities related to a Host asset). (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterRunningKernel(Boolean filterRunningKernel) { - this.filterRunningKernel = filterRunningKernel; - return this; - } + /** + * Get all due date rules. + * + *

See {@link #listSecurityFindingsAutomationDueDateRulesWithHttpInfo}. + * + * @return DueDateRulesResponse + * @throws ApiException if fails to make API call + */ + public DueDateRulesResponse listSecurityFindingsAutomationDueDateRules() throws ApiException { + return listSecurityFindingsAutomationDueDateRulesWithHttpInfo( + new ListSecurityFindingsAutomationDueDateRulesOptionalParameters()) + .getData(); + } - /** - * Set filterAssetName. - * - * @param filterAssetName Filter by asset name. This field supports the usage of wildcards (*). - * (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetName(String filterAssetName) { - this.filterAssetName = filterAssetName; - return this; - } + /** + * Get all due date rules. + * + *

See {@link #listSecurityFindingsAutomationDueDateRulesWithHttpInfoAsync}. + * + * @return CompletableFuture<DueDateRulesResponse> + */ + public CompletableFuture listSecurityFindingsAutomationDueDateRulesAsync() { + return listSecurityFindingsAutomationDueDateRulesWithHttpInfoAsync( + new ListSecurityFindingsAutomationDueDateRulesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } - /** - * Set filterAssetType. - * - * @param filterAssetType Filter by asset type. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetType(AssetType filterAssetType) { - this.filterAssetType = filterAssetType; - return this; - } + /** + * Get all due date rules. + * + *

See {@link #listSecurityFindingsAutomationDueDateRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return DueDateRulesResponse + * @throws ApiException if fails to make API call + */ + public DueDateRulesResponse listSecurityFindingsAutomationDueDateRules( + ListSecurityFindingsAutomationDueDateRulesOptionalParameters parameters) throws ApiException { + return listSecurityFindingsAutomationDueDateRulesWithHttpInfo(parameters).getData(); + } - /** - * Set filterAssetVersionFirst. - * - * @param filterAssetVersionFirst Filter by the first version of the asset this vulnerability - * has been detected on. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetVersionFirst( - String filterAssetVersionFirst) { - this.filterAssetVersionFirst = filterAssetVersionFirst; - return this; - } + /** + * Get all due date rules. + * + *

See {@link #listSecurityFindingsAutomationDueDateRulesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<DueDateRulesResponse> + */ + public CompletableFuture listSecurityFindingsAutomationDueDateRulesAsync( + ListSecurityFindingsAutomationDueDateRulesOptionalParameters parameters) { + return listSecurityFindingsAutomationDueDateRulesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } - /** - * Set filterAssetVersionLast. - * - * @param filterAssetVersionLast Filter by the last version of the asset this vulnerability has - * been detected on. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetVersionLast( - String filterAssetVersionLast) { - this.filterAssetVersionLast = filterAssetVersionLast; - return this; + /** + * Get all due date rules for the current organization. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<DueDateRulesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Successfully retrieved the list of due date rules -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listSecurityFindingsAutomationDueDateRulesWithHttpInfo( + ListSecurityFindingsAutomationDueDateRulesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listSecurityFindingsAutomationDueDateRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/due_date_rules"; - /** - * Set filterAssetRepositoryUrl. - * - * @param filterAssetRepositoryUrl Filter by the repository url associated to the asset. - * (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRepositoryUrl( - String filterAssetRepositoryUrl) { - this.filterAssetRepositoryUrl = filterAssetRepositoryUrl; - return this; - } + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); - /** - * Set filterAssetRisksInProduction. - * - * @param filterAssetRisksInProduction Filter whether the asset is in production or not. - * (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksInProduction( - Boolean filterAssetRisksInProduction) { - this.filterAssetRisksInProduction = filterAssetRisksInProduction; - return this; - } + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - /** - * Set filterAssetRisksUnderAttack. - * - * @param filterAssetRisksUnderAttack Filter whether the asset is under attack or not. - * (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksUnderAttack( - Boolean filterAssetRisksUnderAttack) { - this.filterAssetRisksUnderAttack = filterAssetRisksUnderAttack; - return this; - } + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFindingsAutomationDueDateRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } - /** - * Set filterAssetRisksIsPubliclyAccessible. - * - * @param filterAssetRisksIsPubliclyAccessible Filter whether the asset is publicly accessible - * or not. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksIsPubliclyAccessible( - Boolean filterAssetRisksIsPubliclyAccessible) { - this.filterAssetRisksIsPubliclyAccessible = filterAssetRisksIsPubliclyAccessible; - return this; + /** + * Get all due date rules. + * + *

See {@link #listSecurityFindingsAutomationDueDateRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<DueDateRulesResponse>> + */ + public CompletableFuture> + listSecurityFindingsAutomationDueDateRulesWithHttpInfoAsync( + ListSecurityFindingsAutomationDueDateRulesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listSecurityFindingsAutomationDueDateRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/due_date_rules"; - /** - * Set filterAssetRisksHasPrivilegedAccess. - * - * @param filterAssetRisksHasPrivilegedAccess Filter whether the asset is publicly accessible or - * not. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksHasPrivilegedAccess( - Boolean filterAssetRisksHasPrivilegedAccess) { - this.filterAssetRisksHasPrivilegedAccess = filterAssetRisksHasPrivilegedAccess; - return this; - } + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); - /** - * Set filterAssetRisksHasAccessToSensitiveData. - * - * @param filterAssetRisksHasAccessToSensitiveData Filter whether the asset has access to - * sensitive data or not. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetRisksHasAccessToSensitiveData( - Boolean filterAssetRisksHasAccessToSensitiveData) { - this.filterAssetRisksHasAccessToSensitiveData = filterAssetRisksHasAccessToSensitiveData; - return this; - } + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - /** - * Set filterAssetEnvironments. - * - * @param filterAssetEnvironments Filter by asset environments. (optional) - * @return ListVulnerabilitiesOptionalParameters - */ - public ListVulnerabilitiesOptionalParameters filterAssetEnvironments( - String filterAssetEnvironments) { - this.filterAssetEnvironments = filterAssetEnvironments; - return this; + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFindingsAutomationDueDateRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSecurityFindingsAutomationMuteRules. */ + public static class ListSecurityFindingsAutomationMuteRulesOptionalParameters { + private Long pageSize; + private Long pageNumber; /** - * Set filterAssetTeams. + * Set pageSize. * - * @param filterAssetTeams Filter by asset teams. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageSize The number of rules per page. Maximum is 1000. (optional, default to 1000) + * @return ListSecurityFindingsAutomationMuteRulesOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterAssetTeams(String filterAssetTeams) { - this.filterAssetTeams = filterAssetTeams; + public ListSecurityFindingsAutomationMuteRulesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; return this; } /** - * Set filterAssetArch. + * Set pageNumber. * - * @param filterAssetArch Filter by asset architecture. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageNumber The page number to return. (optional, default to 0) + * @return ListSecurityFindingsAutomationMuteRulesOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterAssetArch(String filterAssetArch) { - this.filterAssetArch = filterAssetArch; + public ListSecurityFindingsAutomationMuteRulesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; return this; } + } - /** - * Set filterAssetOperatingSystemName. - * - * @param filterAssetOperatingSystemName Filter by asset operating system name. (optional) - * @return ListVulnerabilitiesOptionalParameters + /** + * Get all mute rules. + * + *

See {@link #listSecurityFindingsAutomationMuteRulesWithHttpInfo}. + * + * @return MuteRulesResponse + * @throws ApiException if fails to make API call + */ + public MuteRulesResponse listSecurityFindingsAutomationMuteRules() throws ApiException { + return listSecurityFindingsAutomationMuteRulesWithHttpInfo( + new ListSecurityFindingsAutomationMuteRulesOptionalParameters()) + .getData(); + } + + /** + * Get all mute rules. + * + *

See {@link #listSecurityFindingsAutomationMuteRulesWithHttpInfoAsync}. + * + * @return CompletableFuture<MuteRulesResponse> + */ + public CompletableFuture listSecurityFindingsAutomationMuteRulesAsync() { + return listSecurityFindingsAutomationMuteRulesWithHttpInfoAsync( + new ListSecurityFindingsAutomationMuteRulesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all mute rules. + * + *

See {@link #listSecurityFindingsAutomationMuteRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return MuteRulesResponse + * @throws ApiException if fails to make API call + */ + public MuteRulesResponse listSecurityFindingsAutomationMuteRules( + ListSecurityFindingsAutomationMuteRulesOptionalParameters parameters) throws ApiException { + return listSecurityFindingsAutomationMuteRulesWithHttpInfo(parameters).getData(); + } + + /** + * Get all mute rules. + * + *

See {@link #listSecurityFindingsAutomationMuteRulesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<MuteRulesResponse> + */ + public CompletableFuture listSecurityFindingsAutomationMuteRulesAsync( + ListSecurityFindingsAutomationMuteRulesOptionalParameters parameters) { + return listSecurityFindingsAutomationMuteRulesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all mute rules for the current organization. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<MuteRulesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Successfully retrieved the list of mute rules -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listSecurityFindingsAutomationMuteRulesWithHttpInfo( + ListSecurityFindingsAutomationMuteRulesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listSecurityFindingsAutomationMuteRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/mute_rules"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFindingsAutomationMuteRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all mute rules. + * + *

See {@link #listSecurityFindingsAutomationMuteRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<MuteRulesResponse>> + */ + public CompletableFuture> + listSecurityFindingsAutomationMuteRulesWithHttpInfoAsync( + ListSecurityFindingsAutomationMuteRulesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listSecurityFindingsAutomationMuteRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/mute_rules"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFindingsAutomationMuteRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSecurityFindingsAutomationTicketCreationRules. */ + public static class ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters { + private Long pageSize; + private Long pageNumber; + + /** + * Set pageSize. + * + * @param pageSize The number of rules per page. Maximum is 1000. (optional, default to 1000) + * @return ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterAssetOperatingSystemName( - String filterAssetOperatingSystemName) { - this.filterAssetOperatingSystemName = filterAssetOperatingSystemName; + public ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters pageSize( + Long pageSize) { + this.pageSize = pageSize; return this; } /** - * Set filterAssetOperatingSystemVersion. + * Set pageNumber. * - * @param filterAssetOperatingSystemVersion Filter by asset operating system version. (optional) - * @return ListVulnerabilitiesOptionalParameters + * @param pageNumber The page number to return. (optional, default to 0) + * @return ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters */ - public ListVulnerabilitiesOptionalParameters filterAssetOperatingSystemVersion( - String filterAssetOperatingSystemVersion) { - this.filterAssetOperatingSystemVersion = filterAssetOperatingSystemVersion; + public ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters pageNumber( + Long pageNumber) { + this.pageNumber = pageNumber; return this; } } /** - * List vulnerabilities. + * Get all ticket creation rules. * - *

See {@link #listVulnerabilitiesWithHttpInfo}. + *

See {@link #listSecurityFindingsAutomationTicketCreationRulesWithHttpInfo}. * - * @return ListVulnerabilitiesResponse + * @return TicketCreationRulesResponse * @throws ApiException if fails to make API call - * @deprecated */ - @Deprecated - public ListVulnerabilitiesResponse listVulnerabilities() throws ApiException { - return listVulnerabilitiesWithHttpInfo(new ListVulnerabilitiesOptionalParameters()).getData(); + public TicketCreationRulesResponse listSecurityFindingsAutomationTicketCreationRules() + throws ApiException { + return listSecurityFindingsAutomationTicketCreationRulesWithHttpInfo( + new ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters()) + .getData(); + } + + /** + * Get all ticket creation rules. + * + *

See {@link #listSecurityFindingsAutomationTicketCreationRulesWithHttpInfoAsync}. + * + * @return CompletableFuture<TicketCreationRulesResponse> + */ + public CompletableFuture + listSecurityFindingsAutomationTicketCreationRulesAsync() { + return listSecurityFindingsAutomationTicketCreationRulesWithHttpInfoAsync( + new ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all ticket creation rules. + * + *

See {@link #listSecurityFindingsAutomationTicketCreationRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return TicketCreationRulesResponse + * @throws ApiException if fails to make API call + */ + public TicketCreationRulesResponse listSecurityFindingsAutomationTicketCreationRules( + ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters parameters) + throws ApiException { + return listSecurityFindingsAutomationTicketCreationRulesWithHttpInfo(parameters).getData(); + } + + /** + * Get all ticket creation rules. + * + *

See {@link #listSecurityFindingsAutomationTicketCreationRulesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<TicketCreationRulesResponse> + */ + public CompletableFuture + listSecurityFindingsAutomationTicketCreationRulesAsync( + ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters parameters) { + return listSecurityFindingsAutomationTicketCreationRulesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all ticket creation rules for the current organization. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<TicketCreationRulesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Successfully retrieved the list of ticket creation rules -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse + listSecurityFindingsAutomationTicketCreationRulesWithHttpInfo( + ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listSecurityFindingsAutomationTicketCreationRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/ticket_creation_rules"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFindingsAutomationTicketCreationRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all ticket creation rules. + * + *

See {@link #listSecurityFindingsAutomationTicketCreationRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<TicketCreationRulesResponse>> + */ + public CompletableFuture> + listSecurityFindingsAutomationTicketCreationRulesWithHttpInfoAsync( + ListSecurityFindingsAutomationTicketCreationRulesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listSecurityFindingsAutomationTicketCreationRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/ticket_creation_rules"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityFindingsAutomationTicketCreationRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get all critical assets. + * + *

See {@link #listSecurityMonitoringCriticalAssetsWithHttpInfo}. + * + * @return SecurityMonitoringCriticalAssetsResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringCriticalAssetsResponse listSecurityMonitoringCriticalAssets() + throws ApiException { + return listSecurityMonitoringCriticalAssetsWithHttpInfo().getData(); + } + + /** + * Get all critical assets. + * + *

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

See {@link #listSecurityMonitoringCriticalAssetsWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<SecurityMonitoringCriticalAssetsResponse>> + */ + public CompletableFuture> + listSecurityMonitoringCriticalAssetsWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/critical_assets"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringCriticalAssets", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSecurityMonitoringDatasets. */ + public static class ListSecurityMonitoringDatasetsOptionalParameters { + private Long pageSize; + private Long pageNumber; + private String sort; + private String filterQuery; + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 50) + * @return ListSecurityMonitoringDatasetsOptionalParameters + */ + public ListSecurityMonitoringDatasetsOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 1) + * @return ListSecurityMonitoringDatasetsOptionalParameters + */ + public ListSecurityMonitoringDatasetsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set sort. + * + * @param sort Attribute used to sort datasets. Prefix with - to sort in descending + * order. (optional) + * @return ListSecurityMonitoringDatasetsOptionalParameters + */ + public ListSecurityMonitoringDatasetsOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set filterQuery. + * + * @param filterQuery A search query to filter datasets by name or description. (optional) + * @return ListSecurityMonitoringDatasetsOptionalParameters + */ + public ListSecurityMonitoringDatasetsOptionalParameters filterQuery(String filterQuery) { + this.filterQuery = filterQuery; + return this; + } + } + + /** + * List datasets. + * + *

See {@link #listSecurityMonitoringDatasetsWithHttpInfo}. + * + * @return SecurityMonitoringDatasetsListResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringDatasetsListResponse listSecurityMonitoringDatasets() + throws ApiException { + return listSecurityMonitoringDatasetsWithHttpInfo( + new ListSecurityMonitoringDatasetsOptionalParameters()) + .getData(); + } + + /** + * List datasets. + * + *

See {@link #listSecurityMonitoringDatasetsWithHttpInfoAsync}. + * + * @return CompletableFuture<SecurityMonitoringDatasetsListResponse> + */ + public CompletableFuture + listSecurityMonitoringDatasetsAsync() { + return listSecurityMonitoringDatasetsWithHttpInfoAsync( + new ListSecurityMonitoringDatasetsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List datasets. + * + *

See {@link #listSecurityMonitoringDatasetsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return SecurityMonitoringDatasetsListResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringDatasetsListResponse listSecurityMonitoringDatasets( + ListSecurityMonitoringDatasetsOptionalParameters parameters) throws ApiException { + return listSecurityMonitoringDatasetsWithHttpInfo(parameters).getData(); + } + + /** + * List datasets. + * + *

See {@link #listSecurityMonitoringDatasetsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SecurityMonitoringDatasetsListResponse> + */ + public CompletableFuture + listSecurityMonitoringDatasetsAsync( + ListSecurityMonitoringDatasetsOptionalParameters parameters) { + return listSecurityMonitoringDatasetsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List all Cloud SIEM datasets available to the organization, including both customer-defined + * datasets and Datadog out-of-the-box datasets. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<SecurityMonitoringDatasetsListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse + listSecurityMonitoringDatasetsWithHttpInfo( + ListSecurityMonitoringDatasetsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listSecurityMonitoringDatasets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String sort = parameters.sort; + String filterQuery = parameters.filterQuery; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/datasets"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringDatasets", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List datasets. + * + *

See {@link #listSecurityMonitoringDatasetsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SecurityMonitoringDatasetsListResponse>> + */ + public CompletableFuture> + listSecurityMonitoringDatasetsWithHttpInfoAsync( + ListSecurityMonitoringDatasetsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listSecurityMonitoringDatasets"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String sort = parameters.sort; + String filterQuery = parameters.filterQuery; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/datasets"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringDatasets", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSecurityMonitoringHistsignals. */ + public static class ListSecurityMonitoringHistsignalsOptionalParameters { + private String filterQuery; + private OffsetDateTime filterFrom; + private OffsetDateTime filterTo; + private SecurityMonitoringSignalsSort sort; + private String pageCursor; + private Integer pageLimit; + + /** + * Set filterQuery. + * + * @param filterQuery The search query for security signals. (optional) + * @return ListSecurityMonitoringHistsignalsOptionalParameters + */ + public ListSecurityMonitoringHistsignalsOptionalParameters filterQuery(String filterQuery) { + this.filterQuery = filterQuery; + return this; + } + + /** + * Set filterFrom. + * + * @param filterFrom The minimum timestamp for requested security signals. (optional) + * @return ListSecurityMonitoringHistsignalsOptionalParameters + */ + public ListSecurityMonitoringHistsignalsOptionalParameters filterFrom( + OffsetDateTime filterFrom) { + this.filterFrom = filterFrom; + return this; + } + + /** + * Set filterTo. + * + * @param filterTo The maximum timestamp for requested security signals. (optional) + * @return ListSecurityMonitoringHistsignalsOptionalParameters + */ + public ListSecurityMonitoringHistsignalsOptionalParameters filterTo(OffsetDateTime filterTo) { + this.filterTo = filterTo; + return this; + } + + /** + * Set sort. + * + * @param sort The order of the security signals in results. (optional) + * @return ListSecurityMonitoringHistsignalsOptionalParameters + */ + public ListSecurityMonitoringHistsignalsOptionalParameters sort( + SecurityMonitoringSignalsSort sort) { + this.sort = sort; + return this; + } + + /** + * Set pageCursor. + * + * @param pageCursor A list of results using the cursor provided in the previous query. + * (optional) + * @return ListSecurityMonitoringHistsignalsOptionalParameters + */ + public ListSecurityMonitoringHistsignalsOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; + return this; + } + + /** + * Set pageLimit. + * + * @param pageLimit The maximum number of security signals in the response. (optional, default + * to 10) + * @return ListSecurityMonitoringHistsignalsOptionalParameters + */ + public ListSecurityMonitoringHistsignalsOptionalParameters pageLimit(Integer pageLimit) { + this.pageLimit = pageLimit; + return this; + } + } + + /** + * List hist signals. + * + *

See {@link #listSecurityMonitoringHistsignalsWithHttpInfo}. + * + * @return SecurityMonitoringSignalsListResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringSignalsListResponse listSecurityMonitoringHistsignals() + throws ApiException { + return listSecurityMonitoringHistsignalsWithHttpInfo( + new ListSecurityMonitoringHistsignalsOptionalParameters()) + .getData(); + } + + /** + * List hist signals. + * + *

See {@link #listSecurityMonitoringHistsignalsWithHttpInfoAsync}. + * + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + */ + public CompletableFuture + listSecurityMonitoringHistsignalsAsync() { + return listSecurityMonitoringHistsignalsWithHttpInfoAsync( + new ListSecurityMonitoringHistsignalsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List hist signals. + * + *

See {@link #listSecurityMonitoringHistsignalsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return SecurityMonitoringSignalsListResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringSignalsListResponse listSecurityMonitoringHistsignals( + ListSecurityMonitoringHistsignalsOptionalParameters parameters) throws ApiException { + return listSecurityMonitoringHistsignalsWithHttpInfo(parameters).getData(); + } + + /** + * List hist signals. + * + *

See {@link #listSecurityMonitoringHistsignalsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + */ + public CompletableFuture + listSecurityMonitoringHistsignalsAsync( + ListSecurityMonitoringHistsignalsOptionalParameters parameters) { + return listSecurityMonitoringHistsignalsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List hist signals. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<SecurityMonitoringSignalsListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse + listSecurityMonitoringHistsignalsWithHttpInfo( + ListSecurityMonitoringHistsignalsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listSecurityMonitoringHistsignals"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + String filterQuery = parameters.filterQuery; + OffsetDateTime filterFrom = parameters.filterFrom; + OffsetDateTime filterTo = parameters.filterTo; + SecurityMonitoringSignalsSort sort = parameters.sort; + String pageCursor = parameters.pageCursor; + Integer pageLimit = parameters.pageLimit; + // create path and map variables + String localVarPath = "/api/v2/siem-historical-detections/histsignals"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringHistsignals", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List hist signals. + * + *

See {@link #listSecurityMonitoringHistsignalsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> + */ + public CompletableFuture> + listSecurityMonitoringHistsignalsWithHttpInfoAsync( + ListSecurityMonitoringHistsignalsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listSecurityMonitoringHistsignals"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + String filterQuery = parameters.filterQuery; + OffsetDateTime filterFrom = parameters.filterFrom; + OffsetDateTime filterTo = parameters.filterTo; + SecurityMonitoringSignalsSort sort = parameters.sort; + String pageCursor = parameters.pageCursor; + Integer pageLimit = parameters.pageLimit; + // create path and map variables + String localVarPath = "/api/v2/siem-historical-detections/histsignals"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringHistsignals", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSecurityMonitoringIntegrationConfigs. */ + public static class ListSecurityMonitoringIntegrationConfigsOptionalParameters { + private SecurityMonitoringIntegrationType filterIntegrationType; + + /** + * Set filterIntegrationType. + * + * @param filterIntegrationType Filter the entity context sync configurations by source type. + * (optional) + * @return ListSecurityMonitoringIntegrationConfigsOptionalParameters + */ + public ListSecurityMonitoringIntegrationConfigsOptionalParameters filterIntegrationType( + SecurityMonitoringIntegrationType filterIntegrationType) { + this.filterIntegrationType = filterIntegrationType; + return this; + } + } + + /** + * List entity context sync configurations. + * + *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfo}. + * + * @return SecurityMonitoringIntegrationConfigsResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringIntegrationConfigsResponse listSecurityMonitoringIntegrationConfigs() + throws ApiException { + return listSecurityMonitoringIntegrationConfigsWithHttpInfo( + new ListSecurityMonitoringIntegrationConfigsOptionalParameters()) + .getData(); + } + + /** + * List entity context sync configurations. + * + *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync}. + * + * @return CompletableFuture<SecurityMonitoringIntegrationConfigsResponse> + */ + public CompletableFuture + listSecurityMonitoringIntegrationConfigsAsync() { + return listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync( + new ListSecurityMonitoringIntegrationConfigsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List entity context sync configurations. + * + *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return SecurityMonitoringIntegrationConfigsResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringIntegrationConfigsResponse listSecurityMonitoringIntegrationConfigs( + ListSecurityMonitoringIntegrationConfigsOptionalParameters parameters) throws ApiException { + return listSecurityMonitoringIntegrationConfigsWithHttpInfo(parameters).getData(); + } + + /** + * List entity context sync configurations. + * + *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SecurityMonitoringIntegrationConfigsResponse> + */ + public CompletableFuture + listSecurityMonitoringIntegrationConfigsAsync( + ListSecurityMonitoringIntegrationConfigsOptionalParameters parameters) { + return listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List the entity context sync configurations for Cloud SIEM. Each configuration connects Cloud + * SIEM to an external source that provides entities (for example, users from an identity + * provider) for use in signals and the entity explorer. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<SecurityMonitoringIntegrationConfigsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + listSecurityMonitoringIntegrationConfigsWithHttpInfo( + ListSecurityMonitoringIntegrationConfigsOptionalParameters parameters) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listSecurityMonitoringIntegrationConfigs"; + 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; + SecurityMonitoringIntegrationType filterIntegrationType = parameters.filterIntegrationType; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/integration_config"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[integration_type]", filterIntegrationType)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringIntegrationConfigs", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List entity context sync configurations. + * + *

See {@link #listSecurityMonitoringIntegrationConfigsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringIntegrationConfigsResponse>> + */ + public CompletableFuture> + listSecurityMonitoringIntegrationConfigsWithHttpInfoAsync( + ListSecurityMonitoringIntegrationConfigsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listSecurityMonitoringIntegrationConfigs"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + SecurityMonitoringIntegrationType filterIntegrationType = parameters.filterIntegrationType; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/integration_config"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[integration_type]", filterIntegrationType)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringIntegrationConfigs", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSecurityMonitoringRules. */ + public static class ListSecurityMonitoringRulesOptionalParameters { + private Long pageSize; + private Long pageNumber; + private String query; + private SecurityMonitoringRuleSort sort; + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. The maximum allowed value is 100. (optional, default + * to 10) + * @return ListSecurityMonitoringRulesOptionalParameters + */ + public ListSecurityMonitoringRulesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return ListSecurityMonitoringRulesOptionalParameters + */ + public ListSecurityMonitoringRulesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set query. + * + * @param query A search query to filter security rules. You can filter by attributes such as + * type, source, tags. (optional) + * @return ListSecurityMonitoringRulesOptionalParameters + */ + public ListSecurityMonitoringRulesOptionalParameters query(String query) { + this.query = query; + return this; + } + + /** + * Set sort. + * + * @param sort Attribute used to sort rules. Prefix with - to sort in descending + * order. (optional) + * @return ListSecurityMonitoringRulesOptionalParameters + */ + public ListSecurityMonitoringRulesOptionalParameters sort(SecurityMonitoringRuleSort sort) { + this.sort = sort; + return this; + } + } + + /** + * List rules. + * + *

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

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

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

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

See {@link #listSecurityMonitoringRulesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SecurityMonitoringListRulesResponse>> + */ + public CompletableFuture> + listSecurityMonitoringRulesWithHttpInfoAsync( + ListSecurityMonitoringRulesOptionalParameters parameters) { + Object localVarPostBody = null; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String query = parameters.query; + SecurityMonitoringRuleSort sort = parameters.sort; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/rules"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringRules", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSecurityMonitoringSignals. */ + public static class ListSecurityMonitoringSignalsOptionalParameters { + private String filterQuery; + private OffsetDateTime filterFrom; + private OffsetDateTime filterTo; + private SecurityMonitoringSignalsSort sort; + private String pageCursor; + private Integer pageLimit; + + /** + * Set filterQuery. + * + * @param filterQuery The search query for security signals. (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters + */ + public ListSecurityMonitoringSignalsOptionalParameters filterQuery(String filterQuery) { + this.filterQuery = filterQuery; + return this; + } + + /** + * Set filterFrom. + * + * @param filterFrom The minimum timestamp for requested security signals. (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters + */ + public ListSecurityMonitoringSignalsOptionalParameters filterFrom(OffsetDateTime filterFrom) { + this.filterFrom = filterFrom; + return this; + } + + /** + * Set filterTo. + * + * @param filterTo The maximum timestamp for requested security signals. (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters + */ + public ListSecurityMonitoringSignalsOptionalParameters filterTo(OffsetDateTime filterTo) { + this.filterTo = filterTo; + return this; + } + + /** + * Set sort. + * + * @param sort The order of the security signals in results. (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters + */ + public ListSecurityMonitoringSignalsOptionalParameters sort( + SecurityMonitoringSignalsSort sort) { + this.sort = sort; + return this; + } + + /** + * Set pageCursor. + * + * @param pageCursor A list of results using the cursor provided in the previous query. + * (optional) + * @return ListSecurityMonitoringSignalsOptionalParameters + */ + public ListSecurityMonitoringSignalsOptionalParameters pageCursor(String pageCursor) { + this.pageCursor = pageCursor; + return this; + } + + /** + * Set pageLimit. + * + * @param pageLimit The maximum number of security signals in the response. (optional, default + * to 10) + * @return ListSecurityMonitoringSignalsOptionalParameters + */ + public ListSecurityMonitoringSignalsOptionalParameters pageLimit(Integer pageLimit) { + this.pageLimit = pageLimit; + return this; + } + } + + /** + * Get a quick list of security signals. + * + *

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

See {@link #listSecurityMonitoringSignalsWithHttpInfoAsync}. + * + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + */ + public CompletableFuture + listSecurityMonitoringSignalsAsync() { + return listSecurityMonitoringSignalsWithHttpInfoAsync( + new ListSecurityMonitoringSignalsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a quick list of security signals. + * + *

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

See {@link #listSecurityMonitoringSignalsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + */ + public CompletableFuture + listSecurityMonitoringSignalsAsync( + ListSecurityMonitoringSignalsOptionalParameters parameters) { + return listSecurityMonitoringSignalsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a quick list of security signals. + * + *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + * + * @return PaginationIterable<SecurityMonitoringSignal> + */ + public PaginationIterable + listSecurityMonitoringSignalsWithPagination() { + ListSecurityMonitoringSignalsOptionalParameters parameters = + new ListSecurityMonitoringSignalsOptionalParameters(); + return listSecurityMonitoringSignalsWithPagination(parameters); + } + + /** + * Get a quick list of security signals. + * + *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + * + * @return SecurityMonitoringSignalsListResponse + */ + public PaginationIterable listSecurityMonitoringSignalsWithPagination( + ListSecurityMonitoringSignalsOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = "getMeta.getPage.getAfter"; + String valueSetterPath = "pageCursor"; + Boolean valueSetterParamOptional = true; + Integer limit; + + if (parameters.pageLimit == null) { + limit = 10; + parameters.pageLimit(limit); + } else { + limit = parameters.pageLimit; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "listSecurityMonitoringSignals", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + true, + limit, + args, + 0); + + return iterator; + } + + /** + * The list endpoint returns security signals that match a search query. Both this endpoint and + * the POST endpoint can be used interchangeably when listing security signals. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<SecurityMonitoringSignalsListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse + listSecurityMonitoringSignalsWithHttpInfo( + ListSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = null; + String filterQuery = parameters.filterQuery; + OffsetDateTime filterFrom = parameters.filterFrom; + OffsetDateTime filterTo = parameters.filterTo; + SecurityMonitoringSignalsSort sort = parameters.sort; + String pageCursor = parameters.pageCursor; + Integer pageLimit = parameters.pageLimit; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/signals"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringSignals", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a quick list of security signals. + * + *

See {@link #listSecurityMonitoringSignalsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> + */ + public CompletableFuture> + listSecurityMonitoringSignalsWithHttpInfoAsync( + ListSecurityMonitoringSignalsOptionalParameters parameters) { + Object localVarPostBody = null; + String filterQuery = parameters.filterQuery; + OffsetDateTime filterFrom = parameters.filterFrom; + OffsetDateTime filterTo = parameters.filterTo; + SecurityMonitoringSignalsSort sort = parameters.sort; + String pageCursor = parameters.pageCursor; + Integer pageLimit = parameters.pageLimit; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/signals"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[query]", filterQuery)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[from]", filterFrom)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[to]", filterTo)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[cursor]", pageCursor)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringSignals", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSecurityMonitoringSuppressions. */ + public static class ListSecurityMonitoringSuppressionsOptionalParameters { + private String query; + private SecurityMonitoringSuppressionSort sort; + private Long pageSize; + private Long pageNumber; + + /** + * Set query. + * + * @param query Query string. (optional) + * @return ListSecurityMonitoringSuppressionsOptionalParameters + */ + public ListSecurityMonitoringSuppressionsOptionalParameters query(String query) { + this.query = query; + return this; + } + + /** + * Set sort. + * + * @param sort Attribute used to sort the list of suppression rules. Prefix with - + * to sort in descending order. (optional) + * @return ListSecurityMonitoringSuppressionsOptionalParameters + */ + public ListSecurityMonitoringSuppressionsOptionalParameters sort( + SecurityMonitoringSuppressionSort sort) { + this.sort = sort; + return this; + } + + /** + * Set pageSize. + * + * @param pageSize Size for a given page. Use -1 to return all items. (optional, + * default to -1) + * @return ListSecurityMonitoringSuppressionsOptionalParameters + */ + public ListSecurityMonitoringSuppressionsOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Specific page number to return. (optional, default to 0) + * @return ListSecurityMonitoringSuppressionsOptionalParameters + */ + public ListSecurityMonitoringSuppressionsOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + } + + /** + * Get all suppression rules. + * + *

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

See {@link #listSecurityMonitoringSuppressionsWithHttpInfoAsync}. + * + * @return CompletableFuture<SecurityMonitoringPaginatedSuppressionsResponse> + */ + public CompletableFuture + listSecurityMonitoringSuppressionsAsync() { + return listSecurityMonitoringSuppressionsWithHttpInfoAsync( + new ListSecurityMonitoringSuppressionsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get all suppression rules. + * + *

See {@link #listSecurityMonitoringSuppressionsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return SecurityMonitoringPaginatedSuppressionsResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringPaginatedSuppressionsResponse listSecurityMonitoringSuppressions( + ListSecurityMonitoringSuppressionsOptionalParameters parameters) throws ApiException { + return listSecurityMonitoringSuppressionsWithHttpInfo(parameters).getData(); + } + + /** + * Get all suppression rules. + * + *

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

See {@link #listSecurityMonitoringSuppressionsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return + * CompletableFuture<ApiResponse<SecurityMonitoringPaginatedSuppressionsResponse>> + */ + public CompletableFuture> + listSecurityMonitoringSuppressionsWithHttpInfoAsync( + ListSecurityMonitoringSuppressionsOptionalParameters parameters) { + Object localVarPostBody = null; + String query = parameters.query; + SecurityMonitoringSuppressionSort sort = parameters.sort; + Long pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + // create path and map variables + String localVarPath = "/api/v2/security_monitoring/configuration/suppressions"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listSecurityMonitoringSuppressions", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List codegen rulesets. + * + *

See {@link #listStaticAnalysisCodegenRulesetsWithHttpInfo}. + * + * @return SastRulesetsResponse + * @throws ApiException if fails to make API call + */ + public SastRulesetsResponse listStaticAnalysisCodegenRulesets() throws ApiException { + return listStaticAnalysisCodegenRulesetsWithHttpInfo().getData(); + } + + /** + * List codegen rulesets. + * + *

See {@link #listStaticAnalysisCodegenRulesetsWithHttpInfoAsync}. + * + * @return CompletableFuture<SastRulesetsResponse> + */ + public CompletableFuture listStaticAnalysisCodegenRulesetsAsync() { + return listStaticAnalysisCodegenRulesetsWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the rulesets relevant for code generation for the authenticated user. + * + * @return ApiResponse<SastRulesetsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
429 Too many requests -
+ */ + public ApiResponse listStaticAnalysisCodegenRulesetsWithHttpInfo() + throws ApiException { + // Check if unstable operation is enabled + String operationId = "listStaticAnalysisCodegenRulesets"; + 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; + // create path and map variables + String localVarPath = "/api/v2/static-analysis/codegen/rulesets"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listStaticAnalysisCodegenRulesets", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List codegen rulesets. + * + *

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

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

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

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

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

Pagination

+ * + *

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

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

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

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

Token

+ * + *

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

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

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

First request

+ * + *

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

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

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

Note: The first request may take longer to complete than subsequent requests. + * + *

Subsequent requests

+ * + *

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

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

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

The returned token is valid for all requests in the pagination sequence. To + * send paginated requests in parallel, reuse the same token and change only the + * page[number] parameter. + * + *

Filtering

+ * + *

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

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

String filters are case sensitive. + * + *

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

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

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

Metadata

+ * + *

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

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

JSON + * { + * "data": [...], + * "meta": { + * "total": 1500, + * "count": 18732, + * "token": "some_token" + * }, + * "links": {...} + * } + * + *

Extensions

+ * + *

Requests may include extensions to modify the behavior of the requested endpoint. The filter + * parameters follow the JSON:API format + * format: ext:$extension_name, where extension_name is the name of the + * modifier that is being applied. + * + *

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

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

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

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

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

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

Pagination

+ * + *

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

Filtering

+ * + *

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

Metadata

+ * + *

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

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

See {@link #muteSecurityFindingsWithHttpInfo}. + * + * @param body (required) + * @return MuteFindingsResponse + * @throws ApiException if fails to make API call + */ + public MuteFindingsResponse muteSecurityFindings(MuteFindingsRequest body) throws ApiException { + return muteSecurityFindingsWithHttpInfo(body).getData(); + } + + /** + * Mute or unmute security findings. + * + *

See {@link #muteSecurityFindingsWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<MuteFindingsResponse> + */ + public CompletableFuture muteSecurityFindingsAsync( + MuteFindingsRequest body) { + return muteSecurityFindingsWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Mute or unmute security findings. You can mute or unmute up to 100 security findings per + * request. The request body must include is_muted and reason + * attributes. The allowed reasons depend on whether the finding is being muted or unmuted: - To + * mute a finding: PENDING_FIX, FALSE_POSITIVE, OTHER, + * NO_FIX, DUPLICATE, RISK_ACCEPTED. - To unmute a finding: + * NO_PENDING_FIX, HUMAN_ERROR, NO_LONGER_ACCEPTED_RISK, + * OTHER. + * + * @param body (required) + * @return ApiResponse<MuteFindingsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
202 Accepted -
400 Bad Request -
401 Unauthorized -
404 Not Found -
422 Unprocessable Entity -
429 Too many requests -
+ */ + public ApiResponse muteSecurityFindingsWithHttpInfo( + MuteFindingsRequest 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 muteSecurityFindings"); + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/mute"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.muteSecurityFindings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Mute or unmute security findings. + * + *

See {@link #muteSecurityFindingsWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<MuteFindingsResponse>> + */ + public CompletableFuture> muteSecurityFindingsWithHttpInfoAsync( + MuteFindingsRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling muteSecurityFindings")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/mute"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.muteSecurityFindings", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Patch a signal-based notification rule. + * + *

See {@link #patchSignalNotificationRuleWithHttpInfo}. + * + * @param id ID of the notification rule. (required) + * @param body (required) + * @return NotificationRuleResponse + * @throws ApiException if fails to make API call + */ + public NotificationRuleResponse patchSignalNotificationRule( + String id, PatchNotificationRuleParameters body) throws ApiException { + return patchSignalNotificationRuleWithHttpInfo(id, body).getData(); + } + + /** + * Patch a signal-based notification rule. + * + *

See {@link #patchSignalNotificationRuleWithHttpInfoAsync}. + * + * @param id ID of the notification rule. (required) + * @param body (required) + * @return CompletableFuture<NotificationRuleResponse> + */ + public CompletableFuture patchSignalNotificationRuleAsync( + String id, PatchNotificationRuleParameters body) { + return patchSignalNotificationRuleWithHttpInfoAsync(id, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Partially update the notification rule. All fields are optional; if a field is not provided, it + * is not updated. + * + * @param id ID of the notification rule. (required) + * @param body (required) + * @return ApiResponse<NotificationRuleResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Notification rule successfully patched. -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 The server cannot process the request because it contains invalid data. -
429 Too many requests -
+ */ + public ApiResponse patchSignalNotificationRuleWithHttpInfo( + String id, PatchNotificationRuleParameters body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling patchSignalNotificationRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling patchSignalNotificationRule"); + } + // create path and map variables + String localVarPath = + "/api/v2/security/signals/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.patchSignalNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * List vulnerabilities. + * Patch a signal-based notification rule. * - *

See {@link #listVulnerabilitiesWithHttpInfoAsync}. + *

See {@link #patchSignalNotificationRuleWithHttpInfo}. * - * @return CompletableFuture<ListVulnerabilitiesResponse> - * @deprecated + * @param id ID of the notification rule. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> */ - @Deprecated - public CompletableFuture listVulnerabilitiesAsync() { - return listVulnerabilitiesWithHttpInfoAsync(new ListVulnerabilitiesOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + public CompletableFuture> + patchSignalNotificationRuleWithHttpInfoAsync( + String id, PatchNotificationRuleParameters body) { + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling patchSignalNotificationRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling patchSignalNotificationRule")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security/signals/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.patchSignalNotificationRule", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * List vulnerabilities. + * Patch a vulnerability-based notification rule. * - *

See {@link #listVulnerabilitiesWithHttpInfo}. + *

See {@link #patchVulnerabilityNotificationRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return ListVulnerabilitiesResponse + * @param id ID of the notification rule. (required) + * @param body (required) + * @return NotificationRuleResponse * @throws ApiException if fails to make API call - * @deprecated */ - @Deprecated - public ListVulnerabilitiesResponse listVulnerabilities( - ListVulnerabilitiesOptionalParameters parameters) throws ApiException { - return listVulnerabilitiesWithHttpInfo(parameters).getData(); + public NotificationRuleResponse patchVulnerabilityNotificationRule( + String id, PatchNotificationRuleParameters body) throws ApiException { + return patchVulnerabilityNotificationRuleWithHttpInfo(id, body).getData(); } /** - * List vulnerabilities. + * Patch a vulnerability-based notification rule. * - *

See {@link #listVulnerabilitiesWithHttpInfoAsync}. + *

See {@link #patchVulnerabilityNotificationRuleWithHttpInfoAsync}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListVulnerabilitiesResponse> - * @deprecated + * @param id ID of the notification rule. (required) + * @param body (required) + * @return CompletableFuture<NotificationRuleResponse> */ - @Deprecated - public CompletableFuture listVulnerabilitiesAsync( - ListVulnerabilitiesOptionalParameters parameters) { - return listVulnerabilitiesWithHttpInfoAsync(parameters) + public CompletableFuture patchVulnerabilityNotificationRuleAsync( + String id, PatchNotificationRuleParameters body) { + return patchVulnerabilityNotificationRuleWithHttpInfoAsync(id, body) .thenApply( response -> { return response.getData(); @@ -19788,755 +23182,320 @@ public CompletableFuture listVulnerabilitiesAsync( } /** - * Get a list of vulnerabilities. - * - *

Pagination

- * - *

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

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

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

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

Token

- * - *

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

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

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

First request

- * - *

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

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

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

Note: The first request may take longer to complete than subsequent requests. - * - *

Subsequent requests

- * - *

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

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

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

The returned token is valid for all requests in the pagination sequence. To - * send paginated requests in parallel, reuse the same token and change only the - * page[number] parameter. - * - *

Filtering

- * - *

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

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

String filters are case sensitive. - * - *

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

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

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

Metadata

- * - *

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

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

JSON - * { - * "data": [...], - * "meta": { - * "total": 1500, - * "count": 18732, - * "token": "some_token" - * }, - * "links": {...} - * } - * - *

Extensions

- * - *

Requests may include extensions to modify the behavior of the requested endpoint. The filter - * parameters follow the JSON:API format - * format: ext:$extension_name, where extension_name is the name of the - * modifier that is being applied. - * - *

Extensions can only include one value: ext:modifier=value. + * Partially update the notification rule. All fields are optional; if a field is not provided, it + * is not updated. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<ListVulnerabilitiesResponse> + * @param id ID of the notification rule. (required) + * @param body (required) + * @return ApiResponse<NotificationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * - * - * - * + * + * + * + * + * * *
Response details
Status Code Description Response Headers
200 OK -
400 Bad request: The server cannot process the request due to invalid syntax in the request. -
403 Forbidden: Access denied -
404 Not found: There is no request associated with the provided token. -
200 Notification rule successfully patched. -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 The server cannot process the request because it contains invalid data. -
429 Too many requests -
- * - * @deprecated - */ - @Deprecated - public ApiResponse listVulnerabilitiesWithHttpInfo( - ListVulnerabilitiesOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "listVulnerabilities"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + */ + public ApiResponse patchVulnerabilityNotificationRuleWithHttpInfo( + String id, PatchNotificationRuleParameters body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, + "Missing the required parameter 'id' when calling patchVulnerabilityNotificationRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling patchVulnerabilityNotificationRule"); } - Object localVarPostBody = null; - String pageToken = parameters.pageToken; - Long pageNumber = parameters.pageNumber; - VulnerabilityType filterType = parameters.filterType; - Double filterCvssBaseScoreOp = parameters.filterCvssBaseScoreOp; - VulnerabilitySeverity filterCvssBaseSeverity = parameters.filterCvssBaseSeverity; - String filterCvssBaseVector = parameters.filterCvssBaseVector; - Double filterCvssDatadogScoreOp = parameters.filterCvssDatadogScoreOp; - VulnerabilitySeverity filterCvssDatadogSeverity = parameters.filterCvssDatadogSeverity; - String filterCvssDatadogVector = parameters.filterCvssDatadogVector; - VulnerabilityStatus filterStatus = parameters.filterStatus; - VulnerabilityTool filterTool = parameters.filterTool; - String filterLibraryName = parameters.filterLibraryName; - String filterLibraryVersion = parameters.filterLibraryVersion; - String filterAdvisoryId = parameters.filterAdvisoryId; - Boolean filterRisksExploitationProbability = parameters.filterRisksExploitationProbability; - Boolean filterRisksPocExploitAvailable = parameters.filterRisksPocExploitAvailable; - Boolean filterRisksExploitAvailable = parameters.filterRisksExploitAvailable; - Double filterRisksEpssScoreOp = parameters.filterRisksEpssScoreOp; - VulnerabilitySeverity filterRisksEpssSeverity = parameters.filterRisksEpssSeverity; - String filterLanguage = parameters.filterLanguage; - VulnerabilityEcosystem filterEcosystem = parameters.filterEcosystem; - String filterCodeLocationLocation = parameters.filterCodeLocationLocation; - String filterCodeLocationFilePath = parameters.filterCodeLocationFilePath; - String filterCodeLocationMethod = parameters.filterCodeLocationMethod; - Boolean filterFixAvailable = parameters.filterFixAvailable; - String filterRepoDigests = parameters.filterRepoDigests; - String filterOrigin = parameters.filterOrigin; - Boolean filterRunningKernel = parameters.filterRunningKernel; - String filterAssetName = parameters.filterAssetName; - AssetType filterAssetType = parameters.filterAssetType; - String filterAssetVersionFirst = parameters.filterAssetVersionFirst; - String filterAssetVersionLast = parameters.filterAssetVersionLast; - String filterAssetRepositoryUrl = parameters.filterAssetRepositoryUrl; - Boolean filterAssetRisksInProduction = parameters.filterAssetRisksInProduction; - Boolean filterAssetRisksUnderAttack = parameters.filterAssetRisksUnderAttack; - Boolean filterAssetRisksIsPubliclyAccessible = parameters.filterAssetRisksIsPubliclyAccessible; - Boolean filterAssetRisksHasPrivilegedAccess = parameters.filterAssetRisksHasPrivilegedAccess; - Boolean filterAssetRisksHasAccessToSensitiveData = - parameters.filterAssetRisksHasAccessToSensitiveData; - String filterAssetEnvironments = parameters.filterAssetEnvironments; - String filterAssetTeams = parameters.filterAssetTeams; - String filterAssetArch = parameters.filterAssetArch; - String filterAssetOperatingSystemName = parameters.filterAssetOperatingSystemName; - String filterAssetOperatingSystemVersion = parameters.filterAssetOperatingSystemVersion; // create path and map variables - String localVarPath = "/api/v2/security/vulnerabilities"; + String localVarPath = + "/api/v2/security/vulnerabilities/notification_rules/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); - List localVarQueryParams = new ArrayList(); Map localVarHeaderParams = new HashMap(); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[token]", pageToken)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[type]", filterType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.base.score][`$op`]", filterCvssBaseScoreOp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.base.severity]", filterCvssBaseSeverity)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.base.vector]", filterCvssBaseVector)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[cvss.datadog.score][`$op`]", filterCvssDatadogScoreOp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.datadog.severity]", filterCvssDatadogSeverity)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[cvss.datadog.vector]", filterCvssDatadogVector)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[status]", filterStatus)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tool]", filterTool)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[library.name]", filterLibraryName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[library.version]", filterLibraryVersion)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[advisory.id]", filterAdvisoryId)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.exploitation_probability]", filterRisksExploitationProbability)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.poc_exploit_available]", filterRisksPocExploitAvailable)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[risks.exploit_available]", filterRisksExploitAvailable)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.epss.score][`$op`]", filterRisksEpssScoreOp)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[risks.epss.severity]", filterRisksEpssSeverity)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[language]", filterLanguage)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[ecosystem]", filterEcosystem)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[code_location.location]", filterCodeLocationLocation)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[code_location.file_path]", filterCodeLocationFilePath)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[code_location.method]", filterCodeLocationMethod)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[fix_available]", filterFixAvailable)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[repo_digests]", filterRepoDigests)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[origin]", filterOrigin)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[running_kernel]", filterRunningKernel)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.name]", filterAssetName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.type]", filterAssetType)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.version.first]", filterAssetVersionFirst)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.version.last]", filterAssetVersionLast)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.repository_url]", filterAssetRepositoryUrl)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.risks.in_production]", filterAssetRisksInProduction)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.risks.under_attack]", filterAssetRisksUnderAttack)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", - "filter[asset.risks.is_publicly_accessible]", - filterAssetRisksIsPubliclyAccessible)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.risks.has_privileged_access]", filterAssetRisksHasPrivilegedAccess)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", - "filter[asset.risks.has_access_to_sensitive_data]", - filterAssetRisksHasAccessToSensitiveData)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.environments]", filterAssetEnvironments)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.teams]", filterAssetTeams)); - localVarQueryParams.addAll( - apiClient.parameterToPairs("", "filter[asset.arch]", filterAssetArch)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.operating_system.name]", filterAssetOperatingSystemName)); - localVarQueryParams.addAll( - apiClient.parameterToPairs( - "", "filter[asset.operating_system.version]", filterAssetOperatingSystemVersion)); - Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.listVulnerabilities", + "v2.SecurityMonitoringApi.patchVulnerabilityNotificationRule", localVarPath, - localVarQueryParams, + new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "GET", + "PATCH", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * List vulnerabilities. + * Patch a vulnerability-based notification rule. * - *

See {@link #listVulnerabilitiesWithHttpInfo}. + *

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

See {@link #reorderSecurityFindingsAutomationDueDateRulesWithHttpInfo}. + * + * @param body (required) + * @return DueDateRuleReorderRequest + * @throws ApiException if fails to make API call + */ + public DueDateRuleReorderRequest reorderSecurityFindingsAutomationDueDateRules( + DueDateRuleReorderRequest body) throws ApiException { + return reorderSecurityFindingsAutomationDueDateRulesWithHttpInfo(body).getData(); + } - /** - * Set filterRisksUnderAttack. - * - * @param filterRisksUnderAttack Filter whether the asset (Service) is under attack or not. - * (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRisksUnderAttack( - Boolean filterRisksUnderAttack) { - this.filterRisksUnderAttack = filterRisksUnderAttack; - return this; - } + /** + * Reorder due date rules. + * + *

See {@link #reorderSecurityFindingsAutomationDueDateRulesWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<DueDateRuleReorderRequest> + */ + public CompletableFuture + reorderSecurityFindingsAutomationDueDateRulesAsync(DueDateRuleReorderRequest body) { + return reorderSecurityFindingsAutomationDueDateRulesWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } - /** - * Set filterRisksIsPubliclyAccessible. - * - * @param filterRisksIsPubliclyAccessible Filter whether the asset (Host) is publicly accessible - * or not. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRisksIsPubliclyAccessible( - Boolean filterRisksIsPubliclyAccessible) { - this.filterRisksIsPubliclyAccessible = filterRisksIsPubliclyAccessible; - return this; + /** + * Reorder the list of due date rules for the current organization. + * + * @param body (required) + * @return ApiResponse<DueDateRuleReorderRequest> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Successfully reordered the due date rules -
400 Bad Request -
403 Forbidden -
422 Unprocessable Entity -
429 Too many requests -
+ */ + public ApiResponse + reorderSecurityFindingsAutomationDueDateRulesWithHttpInfo(DueDateRuleReorderRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "reorderSecurityFindingsAutomationDueDateRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } + Object localVarPostBody = body; - /** - * Set filterRisksHasPrivilegedAccess. - * - * @param filterRisksHasPrivilegedAccess Filter whether the asset (Host) has privileged access - * or not. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRisksHasPrivilegedAccess( - Boolean filterRisksHasPrivilegedAccess) { - this.filterRisksHasPrivilegedAccess = filterRisksHasPrivilegedAccess; - return this; + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " reorderSecurityFindingsAutomationDueDateRules"); } + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/due_date_rules/reorder"; - /** - * Set filterRisksHasAccessToSensitiveData. - * - * @param filterRisksHasAccessToSensitiveData Filter whether the asset (Host) has access to - * sensitive data or not. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterRisksHasAccessToSensitiveData( - Boolean filterRisksHasAccessToSensitiveData) { - this.filterRisksHasAccessToSensitiveData = filterRisksHasAccessToSensitiveData; - return this; - } + Map localVarHeaderParams = new HashMap(); - /** - * Set filterEnvironments. - * - * @param filterEnvironments Filter by environment. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterEnvironments(String filterEnvironments) { - this.filterEnvironments = filterEnvironments; - return this; - } + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.reorderSecurityFindingsAutomationDueDateRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } - /** - * Set filterTeams. - * - * @param filterTeams Filter by teams. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterTeams(String filterTeams) { - this.filterTeams = filterTeams; - return this; + /** + * Reorder due date rules. + * + *

See {@link #reorderSecurityFindingsAutomationDueDateRulesWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<DueDateRuleReorderRequest>> + */ + public CompletableFuture> + reorderSecurityFindingsAutomationDueDateRulesWithHttpInfoAsync( + DueDateRuleReorderRequest body) { + // Check if unstable operation is enabled + String operationId = "reorderSecurityFindingsAutomationDueDateRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; } + Object localVarPostBody = body; - /** - * Set filterArch. - * - * @param filterArch Filter by architecture. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterArch(String filterArch) { - this.filterArch = filterArch; - return this; + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " reorderSecurityFindingsAutomationDueDateRules")); + return result; } + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/due_date_rules/reorder"; - /** - * Set filterOperatingSystemName. - * - * @param filterOperatingSystemName Filter by operating system name. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterOperatingSystemName( - String filterOperatingSystemName) { - this.filterOperatingSystemName = filterOperatingSystemName; - return this; - } + Map localVarHeaderParams = new HashMap(); - /** - * Set filterOperatingSystemVersion. - * - * @param filterOperatingSystemVersion Filter by operating system version. (optional) - * @return ListVulnerableAssetsOptionalParameters - */ - public ListVulnerableAssetsOptionalParameters filterOperatingSystemVersion( - String filterOperatingSystemVersion) { - this.filterOperatingSystemVersion = filterOperatingSystemVersion; - return this; + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.reorderSecurityFindingsAutomationDueDateRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); } /** - * List vulnerable assets. + * Reorder mute rules. * - *

See {@link #listVulnerableAssetsWithHttpInfo}. + *

See {@link #reorderSecurityFindingsAutomationMuteRulesWithHttpInfo}. * - * @return ListVulnerableAssetsResponse + * @param body (required) + * @return MuteRuleReorderRequest * @throws ApiException if fails to make API call */ - public ListVulnerableAssetsResponse listVulnerableAssets() throws ApiException { - return listVulnerableAssetsWithHttpInfo(new ListVulnerableAssetsOptionalParameters()).getData(); + public MuteRuleReorderRequest reorderSecurityFindingsAutomationMuteRules( + MuteRuleReorderRequest body) throws ApiException { + return reorderSecurityFindingsAutomationMuteRulesWithHttpInfo(body).getData(); } /** - * List vulnerable assets. + * Reorder mute rules. * - *

See {@link #listVulnerableAssetsWithHttpInfoAsync}. + *

See {@link #reorderSecurityFindingsAutomationMuteRulesWithHttpInfoAsync}. * - * @return CompletableFuture<ListVulnerableAssetsResponse> + * @param body (required) + * @return CompletableFuture<MuteRuleReorderRequest> */ - public CompletableFuture listVulnerableAssetsAsync() { - return listVulnerableAssetsWithHttpInfoAsync(new ListVulnerableAssetsOptionalParameters()) + public CompletableFuture reorderSecurityFindingsAutomationMuteRulesAsync( + MuteRuleReorderRequest body) { + return reorderSecurityFindingsAutomationMuteRulesWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -20544,30 +23503,155 @@ public CompletableFuture listVulnerableAssetsAsync } /** - * List vulnerable assets. + * Reorder the list of mute rules for the current organization. + * + * @param body (required) + * @return ApiResponse<MuteRuleReorderRequest> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 Successfully reordered the mute rules -
400 Bad Request -
403 Forbidden -
422 Unprocessable Entity -
429 Too many requests -
+ */ + public ApiResponse reorderSecurityFindingsAutomationMuteRulesWithHttpInfo( + MuteRuleReorderRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "reorderSecurityFindingsAutomationMuteRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " reorderSecurityFindingsAutomationMuteRules"); + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/mute_rules/reorder"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.reorderSecurityFindingsAutomationMuteRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Reorder mute rules. + * + *

See {@link #reorderSecurityFindingsAutomationMuteRulesWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<MuteRuleReorderRequest>> + */ + public CompletableFuture> + reorderSecurityFindingsAutomationMuteRulesWithHttpInfoAsync(MuteRuleReorderRequest body) { + // Check if unstable operation is enabled + String operationId = "reorderSecurityFindingsAutomationMuteRules"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " reorderSecurityFindingsAutomationMuteRules")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/findings/automation/mute_rules/reorder"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.reorderSecurityFindingsAutomationMuteRules", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Reorder ticket creation rules. * - *

See {@link #listVulnerableAssetsWithHttpInfo}. + *

See {@link #reorderSecurityFindingsAutomationTicketCreationRulesWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return ListVulnerableAssetsResponse + * @param body (required) + * @return TicketCreationRuleReorderRequest * @throws ApiException if fails to make API call */ - public ListVulnerableAssetsResponse listVulnerableAssets( - ListVulnerableAssetsOptionalParameters parameters) throws ApiException { - return listVulnerableAssetsWithHttpInfo(parameters).getData(); + public TicketCreationRuleReorderRequest reorderSecurityFindingsAutomationTicketCreationRules( + TicketCreationRuleReorderRequest body) throws ApiException { + return reorderSecurityFindingsAutomationTicketCreationRulesWithHttpInfo(body).getData(); } /** - * List vulnerable assets. + * Reorder ticket creation rules. * - *

See {@link #listVulnerableAssetsWithHttpInfoAsync}. + *

See {@link #reorderSecurityFindingsAutomationTicketCreationRulesWithHttpInfoAsync}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ListVulnerableAssetsResponse> + * @param body (required) + * @return CompletableFuture<TicketCreationRuleReorderRequest> */ - public CompletableFuture listVulnerableAssetsAsync( - ListVulnerableAssetsOptionalParameters parameters) { - return listVulnerableAssetsWithHttpInfoAsync(parameters) + public CompletableFuture + reorderSecurityFindingsAutomationTicketCreationRulesAsync( + TicketCreationRuleReorderRequest body) { + return reorderSecurityFindingsAutomationTicketCreationRulesWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -20575,253 +23659,161 @@ public CompletableFuture listVulnerableAssetsAsync } /** - * Get a list of vulnerable assets. - * - *

Pagination

- * - *

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

Filtering

- * - *

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

Metadata

- * - *

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

See {@link #listVulnerableAssetsWithHttpInfo}. + *

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

See {@link #muteSecurityFindingsWithHttpInfo}. + *

See {@link #restoreSecurityMonitoringRuleWithHttpInfo}. * - * @param body (required) - * @return MuteFindingsResponse + * @param ruleId The ID of the rule. (required) + * @param version The historical version number of the rule. (required) + * @return SecurityMonitoringRuleResponse * @throws ApiException if fails to make API call */ - public MuteFindingsResponse muteSecurityFindings(MuteFindingsRequest body) throws ApiException { - return muteSecurityFindingsWithHttpInfo(body).getData(); + public SecurityMonitoringRuleResponse restoreSecurityMonitoringRule(String ruleId, Long version) + throws ApiException { + return restoreSecurityMonitoringRuleWithHttpInfo(ruleId, version).getData(); } /** - * Mute or unmute security findings. + * Restore a rule to a historical version. * - *

See {@link #muteSecurityFindingsWithHttpInfoAsync}. + *

See {@link #restoreSecurityMonitoringRuleWithHttpInfoAsync}. * - * @param body (required) - * @return CompletableFuture<MuteFindingsResponse> - */ - public CompletableFuture muteSecurityFindingsAsync( - MuteFindingsRequest body) { - return muteSecurityFindingsWithHttpInfoAsync(body) + * @param ruleId The ID of the rule. (required) + * @param version The historical version number of the rule. (required) + * @return CompletableFuture<SecurityMonitoringRuleResponse> + */ + public CompletableFuture restoreSecurityMonitoringRuleAsync( + String ruleId, Long version) { + return restoreSecurityMonitoringRuleWithHttpInfoAsync(ruleId, version) .thenApply( response -> { return response.getData(); @@ -20829,46 +23821,61 @@ public CompletableFuture muteSecurityFindingsAsync( } /** - * Mute or unmute security findings. You can mute or unmute up to 100 security findings per - * request. The request body must include is_muted and reason - * attributes. The allowed reasons depend on whether the finding is being muted or unmuted: - To - * mute a finding: PENDING_FIX, FALSE_POSITIVE, OTHER, - * NO_FIX, DUPLICATE, RISK_ACCEPTED. - To unmute a finding: - * NO_PENDING_FIX, HUMAN_ERROR, NO_LONGER_ACCEPTED_RISK, - * OTHER. + * Restores a custom detection rule to a previously saved historical version. Only custom rules + * can be restored. Default and partner rules return 400. The restore creates a new version entry; + * it does not overwrite history. * - * @param body (required) - * @return ApiResponse<MuteFindingsResponse> + * @param ruleId The ID of the rule. (required) + * @param version The historical version number of the rule. (required) + * @return ApiResponse<SecurityMonitoringRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * * - * + * * *
Response details
Status Code Description Response Headers
202 Accepted -
200 OK -
400 Bad Request -
401 Unauthorized -
403 Not Authorized -
404 Not Found -
422 Unprocessable Entity -
409 Conflict -
429 Too many requests -
*/ - public ApiResponse muteSecurityFindingsWithHttpInfo( - MuteFindingsRequest body) throws ApiException { - Object localVarPostBody = body; + public ApiResponse restoreSecurityMonitoringRuleWithHttpInfo( + String ruleId, Long version) throws ApiException { + // Check if unstable operation is enabled + String operationId = "restoreSecurityMonitoringRule"; + 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 'body' is set - if (body == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling muteSecurityFindings"); + 400, + "Missing the required parameter 'ruleId' when calling restoreSecurityMonitoringRule"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + 400, + "Missing the required parameter 'version' when calling restoreSecurityMonitoringRule"); } // create path and map variables - String localVarPath = "/api/v2/security/findings/mute"; + String localVarPath = + "/api/v2/security_monitoring/rules/{rule_id}/restore/{version}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.muteSecurityFindings", + "v2.SecurityMonitoringApi.restoreSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -20876,38 +23883,68 @@ public ApiResponse muteSecurityFindingsWithHttpInfo( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "PATCH", + "POST", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Mute or unmute security findings. + * Restore a rule to a historical version. * - *

See {@link #muteSecurityFindingsWithHttpInfo}. + *

See {@link #restoreSecurityMonitoringRuleWithHttpInfo}. * - * @param body (required) - * @return CompletableFuture<ApiResponse<MuteFindingsResponse>> + * @param ruleId The ID of the rule. (required) + * @param version The historical version number of the rule. (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleResponse>> */ - public CompletableFuture> muteSecurityFindingsWithHttpInfoAsync( - MuteFindingsRequest body) { - Object localVarPostBody = body; + public CompletableFuture> + restoreSecurityMonitoringRuleWithHttpInfoAsync(String ruleId, Long version) { + // Check if unstable operation is enabled + String operationId = "restoreSecurityMonitoringRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling muteSecurityFindings")); + 400, + "Missing the required parameter 'ruleId' when calling" + + " restoreSecurityMonitoringRule")); + return result; + } + + // verify the required parameter 'version' is set + if (version == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'version' when calling" + + " restoreSecurityMonitoringRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/security/findings/mute"; + String localVarPath = + "/api/v2/security_monitoring/rules/{rule_id}/restore/{version}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); Map localVarHeaderParams = new HashMap(); @@ -20915,7 +23952,7 @@ public CompletableFuture> muteSecurityFindings try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.muteSecurityFindings", + "v2.SecurityMonitoringApi.restoreSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -20923,48 +23960,45 @@ public CompletableFuture> muteSecurityFindings new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "POST", builder, localVarHeaderParams, - new String[] {"application/json"}, + new String[] {}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Patch a signal-based notification rule. + * Run a historical job. * - *

See {@link #patchSignalNotificationRuleWithHttpInfo}. + *

See {@link #runHistoricalJobWithHttpInfo}. * - * @param id ID of the notification rule. (required) * @param body (required) - * @return NotificationRuleResponse + * @return JobCreateResponse * @throws ApiException if fails to make API call */ - public NotificationRuleResponse patchSignalNotificationRule( - String id, PatchNotificationRuleParameters body) throws ApiException { - return patchSignalNotificationRuleWithHttpInfo(id, body).getData(); + public JobCreateResponse runHistoricalJob(RunHistoricalJobRequest body) throws ApiException { + return runHistoricalJobWithHttpInfo(body).getData(); } /** - * Patch a signal-based notification rule. + * Run a historical job. * - *

See {@link #patchSignalNotificationRuleWithHttpInfoAsync}. + *

See {@link #runHistoricalJobWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) * @param body (required) - * @return CompletableFuture<NotificationRuleResponse> + * @return CompletableFuture<JobCreateResponse> */ - public CompletableFuture patchSignalNotificationRuleAsync( - String id, PatchNotificationRuleParameters body) { - return patchSignalNotificationRuleWithHttpInfoAsync(id, body) + public CompletableFuture runHistoricalJobAsync(RunHistoricalJobRequest body) { + return runHistoricalJobWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -20972,103 +24006,96 @@ public CompletableFuture patchSignalNotificationRuleAs } /** - * Partially update the notification rule. All fields are optional; if a field is not provided, it - * is not updated. + * Run a historical job. * - * @param id ID of the notification rule. (required) * @param body (required) - * @return ApiResponse<NotificationRuleResponse> + * @return ApiResponse<JobCreateResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * + * * - * * *
Response details
Status Code Description Response Headers
200 Notification rule successfully patched. -
201 Status created -
400 Bad Request -
403 Forbidden -
401 Concurrent Modification -
403 Not Authorized -
404 Not Found -
422 The server cannot process the request because it contains invalid data. -
429 Too many requests -
*/ - public ApiResponse patchSignalNotificationRuleWithHttpInfo( - String id, PatchNotificationRuleParameters body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - 400, "Missing the required parameter 'id' when calling patchSignalNotificationRule"); + public ApiResponse runHistoricalJobWithHttpInfo(RunHistoricalJobRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "runHistoricalJob"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling patchSignalNotificationRule"); + 400, "Missing the required parameter 'body' when calling runHistoricalJob"); } // create path and map variables - String localVarPath = - "/api/v2/security/signals/notification_rules/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + String localVarPath = "/api/v2/siem-historical-detections/jobs"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.patchSignalNotificationRule", + "v2.SecurityMonitoringApi.runHistoricalJob", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "PATCH", + "POST", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Patch a signal-based notification rule. + * Run a historical job. * - *

See {@link #patchSignalNotificationRuleWithHttpInfo}. + *

See {@link #runHistoricalJobWithHttpInfo}. * - * @param id ID of the notification rule. (required) * @param body (required) - * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> + * @return CompletableFuture<ApiResponse<JobCreateResponse>> */ - public CompletableFuture> - patchSignalNotificationRuleWithHttpInfoAsync( - String id, PatchNotificationRuleParameters body) { - Object localVarPostBody = body; - - // verify the required parameter 'id' is set - if (id == null) { - CompletableFuture> result = new CompletableFuture<>(); + public CompletableFuture> runHistoricalJobWithHttpInfoAsync( + RunHistoricalJobRequest body) { + // Check if unstable operation is enabled + String operationId = "runHistoricalJob"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'id' when calling patchSignalNotificationRule")); + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'body' when calling patchSignalNotificationRule")); + 400, "Missing the required parameter 'body' when calling runHistoricalJob")); return result; } // create path and map variables - String localVarPath = - "/api/v2/security/signals/notification_rules/{id}" - .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + String localVarPath = "/api/v2/siem-historical-detections/jobs"; Map localVarHeaderParams = new HashMap(); @@ -21076,56 +24103,54 @@ public ApiResponse patchSignalNotificationRuleWithHttp try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.patchSignalNotificationRule", + "v2.SecurityMonitoringApi.runHistoricalJob", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "POST", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Patch a vulnerability-based notification rule. + * Search security findings. * - *

See {@link #patchVulnerabilityNotificationRuleWithHttpInfo}. + *

See {@link #searchSecurityFindingsWithHttpInfo}. * - * @param id ID of the notification rule. (required) * @param body (required) - * @return NotificationRuleResponse - * @throws ApiException if fails to make API call - */ - public NotificationRuleResponse patchVulnerabilityNotificationRule( - String id, PatchNotificationRuleParameters body) throws ApiException { - return patchVulnerabilityNotificationRuleWithHttpInfo(id, body).getData(); + * @return ListSecurityFindingsResponse + * @throws ApiException if fails to make API call + */ + public ListSecurityFindingsResponse searchSecurityFindings(SecurityFindingsSearchRequest body) + throws ApiException { + return searchSecurityFindingsWithHttpInfo(body).getData(); } /** - * Patch a vulnerability-based notification rule. + * Search security findings. * - *

See {@link #patchVulnerabilityNotificationRuleWithHttpInfoAsync}. + *

See {@link #searchSecurityFindingsWithHttpInfoAsync}. * - * @param id ID of the notification rule. (required) * @param body (required) - * @return CompletableFuture<NotificationRuleResponse> + * @return CompletableFuture<ListSecurityFindingsResponse> */ - public CompletableFuture patchVulnerabilityNotificationRuleAsync( - String id, PatchNotificationRuleParameters body) { - return patchVulnerabilityNotificationRuleWithHttpInfoAsync(id, body) + public CompletableFuture searchSecurityFindingsAsync( + SecurityFindingsSearchRequest body) { + return searchSecurityFindingsWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -21133,108 +24158,143 @@ public CompletableFuture patchVulnerabilityNotificatio } /** - * Partially update the notification rule. All fields are optional; if a field is not provided, it - * is not updated. + * Search security findings. + * + *

See {@link #searchSecurityFindingsWithHttpInfo}. * - * @param id ID of the notification rule. (required) * @param body (required) - * @return ApiResponse<NotificationRuleResponse> + * @return PaginationIterable<SecurityFindingsData> + */ + public PaginationIterable searchSecurityFindingsWithPagination( + SecurityFindingsSearchRequest body) { + String resultsPath = "getData"; + String valueGetterPath = "getMeta.getPage.getAfter"; + String valueSetterPath = "body.getData.getAttributes.getPage.setCursor"; + Boolean valueSetterParamOptional = false; + Long limit; + + if (body.getData() == null) { + body.setData(new SecurityFindingsSearchRequestData()); + } + + if (body.getData().getAttributes() == null) { + body.getData().setAttributes(new SecurityFindingsSearchRequestDataAttributes()); + } + + if (body.getData().getAttributes().getPage() == null) { + body.getData().getAttributes().setPage(new SecurityFindingsSearchRequestPage()); + } + + if (body.getData().getAttributes().getPage().getLimit() == null) { + limit = 10l; + body.getData().getAttributes().getPage().setLimit(limit); + } else { + limit = body.getData().getAttributes().getPage().getLimit(); + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("body", body); + + PaginationIterable iterator = + new PaginationIterable( + this, + "searchSecurityFindings", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + true, + limit, + args, + 0); + + return iterator; + } + + /** + * Get a list of security findings that match a search query. See the schema for security + * findings. + * + *

Query Syntax

+ * + *

The API uses the logs query syntax. Findings attributes (living in the + * attributes.attributes. namespace) are prefixed by @ when queried. Tags are queried without a + * prefix. + * + *

Example: @severity:(critical OR high) @status:open team:platform + * + * @param body (required) + * @return ApiResponse<ListSecurityFindingsResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * - * - * * *
Response details
Status Code Description Response Headers
200 Notification rule successfully patched. -
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 The server cannot process the request because it contains invalid data. -
429 Too many requests -
*/ - public ApiResponse patchVulnerabilityNotificationRuleWithHttpInfo( - String id, PatchNotificationRuleParameters body) throws ApiException { + public ApiResponse searchSecurityFindingsWithHttpInfo( + SecurityFindingsSearchRequest body) throws ApiException { Object localVarPostBody = body; - // verify the required parameter 'id' is set - if (id == null) { - throw new ApiException( - 400, - "Missing the required parameter 'id' when calling patchVulnerabilityNotificationRule"); - } - // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, - "Missing the required parameter 'body' when calling patchVulnerabilityNotificationRule"); + 400, "Missing the required parameter 'body' when calling searchSecurityFindings"); } // 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/findings/search"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.patchVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.searchSecurityFindings", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "PATCH", + "POST", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Patch a vulnerability-based notification rule. + * Search security findings. * - *

See {@link #patchVulnerabilityNotificationRuleWithHttpInfo}. + *

See {@link #searchSecurityFindingsWithHttpInfo}. * - * @param id ID of the notification rule. (required) * @param body (required) - * @return CompletableFuture<ApiResponse<NotificationRuleResponse>> + * @return CompletableFuture<ApiResponse<ListSecurityFindingsResponse>> */ - public CompletableFuture> - patchVulnerabilityNotificationRuleWithHttpInfoAsync( - String id, PatchNotificationRuleParameters body) { + public CompletableFuture> + searchSecurityFindingsWithHttpInfoAsync(SecurityFindingsSearchRequest body) { Object localVarPostBody = body; - // verify the required parameter 'id' is set - if (id == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'id' when calling" - + " patchVulnerabilityNotificationRule")); - return result; - } - // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " patchVulnerabilityNotificationRule")); + 400, "Missing the required parameter 'body' when calling searchSecurityFindings")); 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/findings/search"; Map localVarHeaderParams = new HashMap(); @@ -21242,56 +24302,73 @@ public ApiResponse patchVulnerabilityNotificationRuleW try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.patchVulnerabilityNotificationRule", + "v2.SecurityMonitoringApi.searchSecurityFindings", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth"}); + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "POST", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to searchSecurityMonitoringHistsignals. */ + public static class SearchSecurityMonitoringHistsignalsOptionalParameters { + private SecurityMonitoringSignalListRequest body; + + /** + * Set body. + * + * @param body (optional) + * @return SearchSecurityMonitoringHistsignalsOptionalParameters + */ + public SearchSecurityMonitoringHistsignalsOptionalParameters body( + SecurityMonitoringSignalListRequest body) { + this.body = body; + return this; + } } /** - * Restore a rule to a historical version. + * Search hist signals. * - *

See {@link #restoreSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @param version The historical version number of the rule. (required) - * @return SecurityMonitoringRuleResponse + * @return SecurityMonitoringSignalsListResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringRuleResponse restoreSecurityMonitoringRule(String ruleId, Long version) + public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals() throws ApiException { - return restoreSecurityMonitoringRuleWithHttpInfo(ruleId, version).getData(); + return searchSecurityMonitoringHistsignalsWithHttpInfo( + new SearchSecurityMonitoringHistsignalsOptionalParameters()) + .getData(); } /** - * Restore a rule to a historical version. + * Search hist signals. * - *

See {@link #restoreSecurityMonitoringRuleWithHttpInfoAsync}. + *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) - * @param version The historical version number of the rule. (required) - * @return CompletableFuture<SecurityMonitoringRuleResponse> + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> */ - public CompletableFuture restoreSecurityMonitoringRuleAsync( - String ruleId, Long version) { - return restoreSecurityMonitoringRuleWithHttpInfoAsync(ruleId, version) + public CompletableFuture + searchSecurityMonitoringHistsignalsAsync() { + return searchSecurityMonitoringHistsignalsWithHttpInfoAsync( + new SearchSecurityMonitoringHistsignalsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -21299,13 +24376,42 @@ public CompletableFuture restoreSecurityMonitori } /** - * Restores a custom detection rule to a previously saved historical version. Only custom rules - * can be restored. Default and partner rules return 400. The restore creates a new version entry; - * it does not overwrite history. + * Search hist signals. * - * @param ruleId The ID of the rule. (required) - * @param version The historical version number of the rule. (required) - * @return ApiResponse<SecurityMonitoringRuleResponse> + *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return SecurityMonitoringSignalsListResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals( + SearchSecurityMonitoringHistsignalsOptionalParameters parameters) throws ApiException { + return searchSecurityMonitoringHistsignalsWithHttpInfo(parameters).getData(); + } + + /** + * Search hist signals. + * + *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + */ + public CompletableFuture + searchSecurityMonitoringHistsignalsAsync( + SearchSecurityMonitoringHistsignalsOptionalParameters parameters) { + return searchSecurityMonitoringHistsignalsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search hist signals. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<SecurityMonitoringSignalsListResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -21315,45 +24421,28 @@ public CompletableFuture restoreSecurityMonitori * * * - * * *
400 Bad Request -
403 Not Authorized -
404 Not Found -
409 Conflict -
429 Too many requests -
*/ - public ApiResponse restoreSecurityMonitoringRuleWithHttpInfo( - String ruleId, Long version) throws ApiException { + public ApiResponse + searchSecurityMonitoringHistsignalsWithHttpInfo( + SearchSecurityMonitoringHistsignalsOptionalParameters parameters) throws ApiException { // Check if unstable operation is enabled - String operationId = "restoreSecurityMonitoringRule"; + String operationId = "searchSecurityMonitoringHistsignals"; 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 'ruleId' is set - if (ruleId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'ruleId' when calling restoreSecurityMonitoringRule"); - } - - // verify the required parameter 'version' is set - if (version == null) { - throw new ApiException( - 400, - "Missing the required parameter 'version' when calling restoreSecurityMonitoringRule"); - } + Object localVarPostBody = parameters.body; // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}/restore/{version}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + String localVarPath = "/api/v2/siem-historical-detections/histsignals/search"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.restoreSecurityMonitoringRule", + "v2.SecurityMonitoringApi.searchSecurityMonitoringHistsignals", localVarPath, new ArrayList(), localVarHeaderParams, @@ -21364,65 +24453,38 @@ public ApiResponse restoreSecurityMonitoringRule "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Restore a rule to a historical version. + * Search hist signals. * - *

See {@link #restoreSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) - * @param version The historical version number of the rule. (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleResponse>> + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> */ - public CompletableFuture> - restoreSecurityMonitoringRuleWithHttpInfoAsync(String ruleId, Long version) { + public CompletableFuture> + searchSecurityMonitoringHistsignalsWithHttpInfoAsync( + SearchSecurityMonitoringHistsignalsOptionalParameters parameters) { // Check if unstable operation is enabled - String operationId = "restoreSecurityMonitoringRule"; + String operationId = "searchSecurityMonitoringHistsignals"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } - Object localVarPostBody = null; - - // verify the required parameter 'ruleId' is set - if (ruleId == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'ruleId' when calling" - + " restoreSecurityMonitoringRule")); - return result; - } - - // verify the required parameter 'version' is set - if (version == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'version' when calling" - + " restoreSecurityMonitoringRule")); - return result; - } + Object localVarPostBody = parameters.body; // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}/restore/{version}" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + String localVarPath = "/api/v2/siem-historical-detections/histsignals/search"; Map localVarHeaderParams = new HashMap(); @@ -21430,7 +24492,7 @@ public ApiResponse restoreSecurityMonitoringRule try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.restoreSecurityMonitoringRule", + "v2.SecurityMonitoringApi.searchSecurityMonitoringHistsignals", localVarPath, new ArrayList(), localVarHeaderParams, @@ -21438,7 +24500,7 @@ public ApiResponse restoreSecurityMonitoringRule new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -21447,36 +24509,56 @@ public ApiResponse restoreSecurityMonitoringRule "POST", builder, localVarHeaderParams, - new String[] {}, + new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); + } + + /** Manage optional parameters to searchSecurityMonitoringSignals. */ + public static class SearchSecurityMonitoringSignalsOptionalParameters { + private SecurityMonitoringSignalListRequest body; + + /** + * Set body. + * + * @param body (optional) + * @return SearchSecurityMonitoringSignalsOptionalParameters + */ + public SearchSecurityMonitoringSignalsOptionalParameters body( + SecurityMonitoringSignalListRequest body) { + this.body = body; + return this; + } } /** - * Run a historical job. + * Get a list of security signals. * - *

See {@link #runHistoricalJobWithHttpInfo}. + *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. * - * @param body (required) - * @return JobCreateResponse + * @return SecurityMonitoringSignalsListResponse * @throws ApiException if fails to make API call */ - public JobCreateResponse runHistoricalJob(RunHistoricalJobRequest body) throws ApiException { - return runHistoricalJobWithHttpInfo(body).getData(); + public SecurityMonitoringSignalsListResponse searchSecurityMonitoringSignals() + throws ApiException { + return searchSecurityMonitoringSignalsWithHttpInfo( + new SearchSecurityMonitoringSignalsOptionalParameters()) + .getData(); } /** - * Run a historical job. + * Get a list of security signals. * - *

See {@link #runHistoricalJobWithHttpInfoAsync}. + *

See {@link #searchSecurityMonitoringSignalsWithHttpInfoAsync}. * - * @param body (required) - * @return CompletableFuture<JobCreateResponse> + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> */ - public CompletableFuture runHistoricalJobAsync(RunHistoricalJobRequest body) { - return runHistoricalJobWithHttpInfoAsync(body) + public CompletableFuture + searchSecurityMonitoringSignalsAsync() { + return searchSecurityMonitoringSignalsWithHttpInfoAsync( + new SearchSecurityMonitoringSignalsOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -21484,47 +24566,130 @@ public CompletableFuture runHistoricalJobAsync(RunHistoricalJ } /** - * Run a historical job. + * Get a list of security signals. * - * @param body (required) - * @return ApiResponse<JobCreateResponse> + *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return SecurityMonitoringSignalsListResponse + * @throws ApiException if fails to make API call + */ + public SecurityMonitoringSignalsListResponse searchSecurityMonitoringSignals( + SearchSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { + return searchSecurityMonitoringSignalsWithHttpInfo(parameters).getData(); + } + + /** + * Get a list of security signals. + * + *

See {@link #searchSecurityMonitoringSignalsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + */ + public CompletableFuture + searchSecurityMonitoringSignalsAsync( + SearchSecurityMonitoringSignalsOptionalParameters parameters) { + return searchSecurityMonitoringSignalsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of security signals. + * + *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. + * + * @return PaginationIterable<SecurityMonitoringSignal> + */ + public PaginationIterable + searchSecurityMonitoringSignalsWithPagination() { + SearchSecurityMonitoringSignalsOptionalParameters parameters = + new SearchSecurityMonitoringSignalsOptionalParameters(); + return searchSecurityMonitoringSignalsWithPagination(parameters); + } + + /** + * Get a list of security signals. + * + *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. + * + * @return SecurityMonitoringSignalsListResponse + */ + public PaginationIterable searchSecurityMonitoringSignalsWithPagination( + SearchSecurityMonitoringSignalsOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = "getMeta.getPage.getAfter"; + String valueSetterPath = "body.getPage.setCursor"; + Boolean valueSetterParamOptional = true; + Integer limit; + + if (parameters.body == null) { + parameters.body(new SecurityMonitoringSignalListRequest()); + } + + if (parameters.body.getPage() == null) { + parameters.body.setPage(new SecurityMonitoringSignalListRequestPage()); + } + + if (parameters.body.getPage().getLimit() == null) { + limit = 10; + parameters.body.getPage().setLimit(limit); + } else { + limit = parameters.body.getPage().getLimit(); + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "searchSecurityMonitoringSignals", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + true, + limit, + args, + 0); + + return iterator; + } + + /** + * Returns security signals that match a search query. Both this endpoint and the GET endpoint can + * be used interchangeably for listing security signals. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<SecurityMonitoringSignalsListResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * * - * * *
Response details
Status Code Description Response Headers
201 Status created -
200 OK -
400 Bad Request -
401 Concurrent Modification -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse runHistoricalJobWithHttpInfo(RunHistoricalJobRequest body) - throws ApiException { - // Check if unstable operation is enabled - String operationId = "runHistoricalJob"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException( - 400, "Missing the required parameter 'body' when calling runHistoricalJob"); - } + public ApiResponse + searchSecurityMonitoringSignalsWithHttpInfo( + SearchSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { + Object localVarPostBody = parameters.body; // create path and map variables - String localVarPath = "/api/v2/siem-historical-detections/jobs"; + String localVarPath = "/api/v2/security_monitoring/signals/search"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.runHistoricalJob", + "v2.SecurityMonitoringApi.searchSecurityMonitoringSignals", localVarPath, new ArrayList(), localVarHeaderParams, @@ -21539,41 +24704,23 @@ public ApiResponse runHistoricalJobWithHttpInfo(RunHistorical localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Run a historical job. + * Get a list of security signals. * - *

See {@link #runHistoricalJobWithHttpInfo}. + *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. * - * @param body (required) - * @return CompletableFuture<ApiResponse<JobCreateResponse>> + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> */ - public CompletableFuture> runHistoricalJobWithHttpInfoAsync( - RunHistoricalJobRequest body) { - // Check if unstable operation is enabled - String operationId = "runHistoricalJob"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'body' when calling runHistoricalJob")); - return result; - } + public CompletableFuture> + searchSecurityMonitoringSignalsWithHttpInfoAsync( + SearchSecurityMonitoringSignalsOptionalParameters parameters) { + Object localVarPostBody = parameters.body; // create path and map variables - String localVarPath = "/api/v2/siem-historical-detections/jobs"; + String localVarPath = "/api/v2/security_monitoring/signals/search"; Map localVarHeaderParams = new HashMap(); @@ -21581,7 +24728,7 @@ public CompletableFuture> runHistoricalJobWithHtt try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.runHistoricalJob", + "v2.SecurityMonitoringApi.searchSecurityMonitoringSignals", localVarPath, new ArrayList(), localVarHeaderParams, @@ -21589,7 +24736,8 @@ public CompletableFuture> runHistoricalJobWithHtt new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = + new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -21601,34 +24749,34 @@ public CompletableFuture> runHistoricalJobWithHtt localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Search security findings. + * Test a notification rule. * - *

See {@link #searchSecurityFindingsWithHttpInfo}. + *

See {@link #sendSecurityMonitoringNotificationPreviewWithHttpInfo}. * * @param body (required) - * @return ListSecurityFindingsResponse + * @return NotificationRulePreviewResponse * @throws ApiException if fails to make API call */ - public ListSecurityFindingsResponse searchSecurityFindings(SecurityFindingsSearchRequest body) - throws ApiException { - return searchSecurityFindingsWithHttpInfo(body).getData(); + public NotificationRulePreviewResponse sendSecurityMonitoringNotificationPreview( + CreateNotificationRuleParameters body) throws ApiException { + return sendSecurityMonitoringNotificationPreviewWithHttpInfo(body).getData(); } /** - * Search security findings. + * Test a notification rule. * - *

See {@link #searchSecurityFindingsWithHttpInfoAsync}. + *

See {@link #sendSecurityMonitoringNotificationPreviewWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<ListSecurityFindingsResponse> + * @return CompletableFuture<NotificationRulePreviewResponse> */ - public CompletableFuture searchSecurityFindingsAsync( - SecurityFindingsSearchRequest body) { - return searchSecurityFindingsWithHttpInfoAsync(body) + public CompletableFuture + sendSecurityMonitoringNotificationPreviewAsync(CreateNotificationRuleParameters body) { + return sendSecurityMonitoringNotificationPreviewWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -21636,75 +24784,10 @@ public CompletableFuture searchSecurityFindingsAsy } /** - * Search security findings. - * - *

See {@link #searchSecurityFindingsWithHttpInfo}. - * - * @param body (required) - * @return PaginationIterable<SecurityFindingsData> - */ - public PaginationIterable searchSecurityFindingsWithPagination( - SecurityFindingsSearchRequest body) { - String resultsPath = "getData"; - String valueGetterPath = "getMeta.getPage.getAfter"; - String valueSetterPath = "body.getData.getAttributes.getPage.setCursor"; - Boolean valueSetterParamOptional = false; - Long limit; - - if (body.getData() == null) { - body.setData(new SecurityFindingsSearchRequestData()); - } - - if (body.getData().getAttributes() == null) { - body.getData().setAttributes(new SecurityFindingsSearchRequestDataAttributes()); - } - - if (body.getData().getAttributes().getPage() == null) { - body.getData().getAttributes().setPage(new SecurityFindingsSearchRequestPage()); - } - - if (body.getData().getAttributes().getPage().getLimit() == null) { - limit = 10l; - body.getData().getAttributes().getPage().setLimit(limit); - } else { - limit = body.getData().getAttributes().getPage().getLimit(); - } - - LinkedHashMap args = new LinkedHashMap(); - args.put("body", body); - - PaginationIterable iterator = - new PaginationIterable( - this, - "searchSecurityFindings", - resultsPath, - valueGetterPath, - valueSetterPath, - valueSetterParamOptional, - true, - true, - limit, - args, - 0); - - return iterator; - } - - /** - * Get a list of security findings that match a search query. See the schema for security - * findings. - * - *

Query Syntax

- * - *

The API uses the logs query syntax. Findings attributes (living in the - * attributes.attributes. namespace) are prefixed by @ when queried. Tags are queried without a - * prefix. - * - *

Example: @severity:(critical OR high) @status:open team:platform + * Send a notification preview to test that a notification rule's targets are properly configured. * * @param body (required) - * @return ApiResponse<ListSecurityFindingsResponse> + * @return ApiResponse<NotificationRulePreviewResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -21712,27 +24795,31 @@ public PaginationIterable searchSecurityFindingsWithPagina * * * - * + * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
403 Not Authorized -
429 Too many requests -
*/ - public ApiResponse searchSecurityFindingsWithHttpInfo( - SecurityFindingsSearchRequest body) throws ApiException { + public ApiResponse + sendSecurityMonitoringNotificationPreviewWithHttpInfo(CreateNotificationRuleParameters 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 searchSecurityFindings"); + 400, + "Missing the required parameter 'body' when calling" + + " sendSecurityMonitoringNotificationPreview"); } // create path and map variables - String localVarPath = "/api/v2/security/findings/search"; + String localVarPath = + "/api/v2/security_monitoring/configuration/notification_rules/send_notification_preview"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.searchSecurityFindings", + "v2.SecurityMonitoringApi.sendSecurityMonitoringNotificationPreview", localVarPath, new ArrayList(), localVarHeaderParams, @@ -21747,32 +24834,36 @@ public ApiResponse searchSecurityFindingsWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Search security findings. + * Test a notification rule. * - *

See {@link #searchSecurityFindingsWithHttpInfo}. + *

See {@link #sendSecurityMonitoringNotificationPreviewWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<ListSecurityFindingsResponse>> + * @return CompletableFuture<ApiResponse<NotificationRulePreviewResponse>> */ - public CompletableFuture> - searchSecurityFindingsWithHttpInfoAsync(SecurityFindingsSearchRequest body) { + public CompletableFuture> + sendSecurityMonitoringNotificationPreviewWithHttpInfoAsync( + CreateNotificationRuleParameters body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling searchSecurityFindings")); + 400, + "Missing the required parameter 'body' when calling" + + " sendSecurityMonitoringNotificationPreview")); return result; } // create path and map variables - String localVarPath = "/api/v2/security/findings/search"; + String localVarPath = + "/api/v2/security_monitoring/configuration/notification_rules/send_notification_preview"; Map localVarHeaderParams = new HashMap(); @@ -21780,7 +24871,7 @@ public ApiResponse searchSecurityFindingsWithHttpI try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.searchSecurityFindings", + "v2.SecurityMonitoringApi.sendSecurityMonitoringNotificationPreview", localVarPath, new ArrayList(), localVarHeaderParams, @@ -21788,7 +24879,7 @@ public ApiResponse searchSecurityFindingsWithHttpI new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -21801,84 +24892,37 @@ public ApiResponse searchSecurityFindingsWithHttpI localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to searchSecurityMonitoringHistsignals. */ - public static class SearchSecurityMonitoringHistsignalsOptionalParameters { - private SecurityMonitoringSignalListRequest body; - - /** - * Set body. - * - * @param body (optional) - * @return SearchSecurityMonitoringHistsignalsOptionalParameters - */ - public SearchSecurityMonitoringHistsignalsOptionalParameters body( - SecurityMonitoringSignalListRequest body) { - this.body = body; - return this; - } - } - - /** - * Search hist signals. - * - *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfo}. - * - * @return SecurityMonitoringSignalsListResponse - * @throws ApiException if fails to make API call - */ - public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals() - throws ApiException { - return searchSecurityMonitoringHistsignalsWithHttpInfo( - new SearchSecurityMonitoringHistsignalsOptionalParameters()) - .getData(); - } - - /** - * Search hist signals. - * - *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfoAsync}. - * - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> - */ - public CompletableFuture - searchSecurityMonitoringHistsignalsAsync() { - return searchSecurityMonitoringHistsignalsWithHttpInfoAsync( - new SearchSecurityMonitoringHistsignalsOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType() {}); } /** - * Search hist signals. + * Test an existing rule. * - *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfo}. + *

See {@link #testExistingSecurityMonitoringRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return SecurityMonitoringSignalsListResponse + * @param ruleId The ID of the rule. (required) + * @param body (required) + * @return SecurityMonitoringRuleTestResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals( - SearchSecurityMonitoringHistsignalsOptionalParameters parameters) throws ApiException { - return searchSecurityMonitoringHistsignalsWithHttpInfo(parameters).getData(); + public SecurityMonitoringRuleTestResponse testExistingSecurityMonitoringRule( + String ruleId, SecurityMonitoringRuleTestRequest body) throws ApiException { + return testExistingSecurityMonitoringRuleWithHttpInfo(ruleId, body).getData(); } /** - * Search hist signals. + * Test an existing rule. * - *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfoAsync}. + *

See {@link #testExistingSecurityMonitoringRuleWithHttpInfoAsync}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> + * @param ruleId The ID of the rule. (required) + * @param body (required) + * @return CompletableFuture<SecurityMonitoringRuleTestResponse> */ - public CompletableFuture - searchSecurityMonitoringHistsignalsAsync( - SearchSecurityMonitoringHistsignalsOptionalParameters parameters) { - return searchSecurityMonitoringHistsignalsWithHttpInfoAsync(parameters) + public CompletableFuture + testExistingSecurityMonitoringRuleAsync( + String ruleId, SecurityMonitoringRuleTestRequest body) { + return testExistingSecurityMonitoringRuleWithHttpInfoAsync(ruleId, body) .thenApply( response -> { return response.getData(); @@ -21886,10 +24930,11 @@ public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals } /** - * Search hist signals. + * Test an existing rule. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringSignalsListResponse> + * @param ruleId The ID of the rule. (required) + * @param body (required) + * @return ApiResponse<SecurityMonitoringRuleTestResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -21897,30 +24942,41 @@ public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals * * * + * * * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Concurrent Modification -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - searchSecurityMonitoringHistsignalsWithHttpInfo( - SearchSecurityMonitoringHistsignalsOptionalParameters parameters) throws ApiException { - // Check if unstable operation is enabled - String operationId = "searchSecurityMonitoringHistsignals"; - 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 + testExistingSecurityMonitoringRuleWithHttpInfo( + String ruleId, SecurityMonitoringRuleTestRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling" + + " testExistingSecurityMonitoringRule"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, + "Missing the required parameter 'body' when calling testExistingSecurityMonitoringRule"); } - Object localVarPostBody = parameters.body; // create path and map variables - String localVarPath = "/api/v2/siem-historical-detections/histsignals/search"; + String localVarPath = + "/api/v2/security_monitoring/rules/{rule_id}/test" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.searchSecurityMonitoringHistsignals", + "v2.SecurityMonitoringApi.testExistingSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -21935,34 +24991,50 @@ public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Search hist signals. + * Test an existing rule. * - *

See {@link #searchSecurityMonitoringHistsignalsWithHttpInfo}. + *

See {@link #testExistingSecurityMonitoringRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> + * @param ruleId The ID of the rule. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleTestResponse>> */ - public CompletableFuture> - searchSecurityMonitoringHistsignalsWithHttpInfoAsync( - SearchSecurityMonitoringHistsignalsOptionalParameters parameters) { - // Check if unstable operation is enabled - String operationId = "searchSecurityMonitoringHistsignals"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = + public CompletableFuture> + testExistingSecurityMonitoringRuleWithHttpInfoAsync( + String ruleId, SecurityMonitoringRuleTestRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling" + + " testExistingSecurityMonitoringRule")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling" + + " testExistingSecurityMonitoringRule")); return result; } - Object localVarPostBody = parameters.body; // create path and map variables - String localVarPath = "/api/v2/siem-historical-detections/histsignals/search"; + String localVarPath = + "/api/v2/security_monitoring/rules/{rule_id}/test" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -21970,7 +25042,7 @@ public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.searchSecurityMonitoringHistsignals", + "v2.SecurityMonitoringApi.testExistingSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -21978,7 +25050,7 @@ public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -21991,160 +25063,45 @@ public SecurityMonitoringSignalsListResponse searchSecurityMonitoringHistsignals localVarPostBody, new HashMap(), false, - new GenericType() {}); - } - - /** Manage optional parameters to searchSecurityMonitoringSignals. */ - public static class SearchSecurityMonitoringSignalsOptionalParameters { - private SecurityMonitoringSignalListRequest body; - - /** - * Set body. - * - * @param body (optional) - * @return SearchSecurityMonitoringSignalsOptionalParameters - */ - public SearchSecurityMonitoringSignalsOptionalParameters body( - SecurityMonitoringSignalListRequest body) { - this.body = body; - return this; - } - } - - /** - * Get a list of security signals. - * - *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. - * - * @return SecurityMonitoringSignalsListResponse - * @throws ApiException if fails to make API call - */ - public SecurityMonitoringSignalsListResponse searchSecurityMonitoringSignals() - throws ApiException { - return searchSecurityMonitoringSignalsWithHttpInfo( - new SearchSecurityMonitoringSignalsOptionalParameters()) - .getData(); - } - - /** - * Get a list of security signals. - * - *

See {@link #searchSecurityMonitoringSignalsWithHttpInfoAsync}. - * - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> - */ - public CompletableFuture - searchSecurityMonitoringSignalsAsync() { - return searchSecurityMonitoringSignalsWithHttpInfoAsync( - new SearchSecurityMonitoringSignalsOptionalParameters()) - .thenApply( - response -> { - return response.getData(); - }); + new GenericType() {}); } /** - * Get a list of security signals. + * Test a rule. * - *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #testSecurityMonitoringRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return SecurityMonitoringSignalsListResponse + * @param body (required) + * @return SecurityMonitoringRuleTestResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringSignalsListResponse searchSecurityMonitoringSignals( - SearchSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { - return searchSecurityMonitoringSignalsWithHttpInfo(parameters).getData(); - } - - /** - * Get a list of security signals. - * - *

See {@link #searchSecurityMonitoringSignalsWithHttpInfoAsync}. - * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<SecurityMonitoringSignalsListResponse> - */ - public CompletableFuture - searchSecurityMonitoringSignalsAsync( - SearchSecurityMonitoringSignalsOptionalParameters parameters) { - return searchSecurityMonitoringSignalsWithHttpInfoAsync(parameters) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Get a list of security signals. - * - *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. - * - * @return PaginationIterable<SecurityMonitoringSignal> - */ - public PaginationIterable - searchSecurityMonitoringSignalsWithPagination() { - SearchSecurityMonitoringSignalsOptionalParameters parameters = - new SearchSecurityMonitoringSignalsOptionalParameters(); - return searchSecurityMonitoringSignalsWithPagination(parameters); + public SecurityMonitoringRuleTestResponse testSecurityMonitoringRule( + SecurityMonitoringRuleTestRequest body) throws ApiException { + return testSecurityMonitoringRuleWithHttpInfo(body).getData(); } /** - * Get a list of security signals. + * Test a rule. * - *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #testSecurityMonitoringRuleWithHttpInfoAsync}. * - * @return SecurityMonitoringSignalsListResponse + * @param body (required) + * @return CompletableFuture<SecurityMonitoringRuleTestResponse> */ - public PaginationIterable searchSecurityMonitoringSignalsWithPagination( - SearchSecurityMonitoringSignalsOptionalParameters parameters) { - String resultsPath = "getData"; - String valueGetterPath = "getMeta.getPage.getAfter"; - String valueSetterPath = "body.getPage.setCursor"; - Boolean valueSetterParamOptional = true; - Integer limit; - - if (parameters.body == null) { - parameters.body(new SecurityMonitoringSignalListRequest()); - } - - if (parameters.body.getPage() == null) { - parameters.body.setPage(new SecurityMonitoringSignalListRequestPage()); - } - - if (parameters.body.getPage().getLimit() == null) { - limit = 10; - parameters.body.getPage().setLimit(limit); - } else { - limit = parameters.body.getPage().getLimit(); - } - - LinkedHashMap args = new LinkedHashMap(); - args.put("optionalParams", parameters); - - PaginationIterable iterator = - new PaginationIterable( - this, - "searchSecurityMonitoringSignals", - resultsPath, - valueGetterPath, - valueSetterPath, - valueSetterParamOptional, - true, - true, - limit, - args, - 0); - - return iterator; + public CompletableFuture testSecurityMonitoringRuleAsync( + SecurityMonitoringRuleTestRequest body) { + return testSecurityMonitoringRuleWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); } /** - * Returns security signals that match a search query. Both this endpoint and the GET endpoint can - * be used interchangeably for listing security signals. + * Test a rule. * - * @param parameters Optional parameters for the request. - * @return ApiResponse<SecurityMonitoringSignalsListResponse> + * @param body (required) + * @return ApiResponse<SecurityMonitoringRuleTestResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -22152,22 +25109,29 @@ public PaginationIterable searchSecurityMonitoringSign * * * + * * + * * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Concurrent Modification -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - searchSecurityMonitoringSignalsWithHttpInfo( - SearchSecurityMonitoringSignalsOptionalParameters parameters) throws ApiException { - Object localVarPostBody = parameters.body; + public ApiResponse testSecurityMonitoringRuleWithHttpInfo( + SecurityMonitoringRuleTestRequest 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 testSecurityMonitoringRule"); + } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/signals/search"; + String localVarPath = "/api/v2/security_monitoring/rules/test"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.searchSecurityMonitoringSignals", + "v2.SecurityMonitoringApi.testSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22182,23 +25146,33 @@ public PaginationIterable searchSecurityMonitoringSign localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Get a list of security signals. + * Test a rule. * - *

See {@link #searchSecurityMonitoringSignalsWithHttpInfo}. + *

See {@link #testSecurityMonitoringRuleWithHttpInfo}. * - * @param parameters Optional parameters for the request. - * @return CompletableFuture<ApiResponse<SecurityMonitoringSignalsListResponse>> + * @param body (required) + * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleTestResponse>> */ - public CompletableFuture> - searchSecurityMonitoringSignalsWithHttpInfoAsync( - SearchSecurityMonitoringSignalsOptionalParameters parameters) { - Object localVarPostBody = parameters.body; + public CompletableFuture> + testSecurityMonitoringRuleWithHttpInfoAsync(SecurityMonitoringRuleTestRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'body' when calling testSecurityMonitoringRule")); + return result; + } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/signals/search"; + String localVarPath = "/api/v2/security_monitoring/rules/test"; Map localVarHeaderParams = new HashMap(); @@ -22206,7 +25180,7 @@ public PaginationIterable searchSecurityMonitoringSign try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.searchSecurityMonitoringSignals", + "v2.SecurityMonitoringApi.testSecurityMonitoringRule", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22214,7 +25188,7 @@ public PaginationIterable searchSecurityMonitoringSign new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; @@ -22227,34 +25201,38 @@ public PaginationIterable searchSecurityMonitoringSign localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Test a notification rule. + * Update a custom framework. * - *

See {@link #sendSecurityMonitoringNotificationPreviewWithHttpInfo}. + *

See {@link #updateCustomFrameworkWithHttpInfo}. * + * @param handle The framework handle (required) + * @param version The framework version (required) * @param body (required) - * @return NotificationRulePreviewResponse + * @return UpdateCustomFrameworkResponse * @throws ApiException if fails to make API call */ - public NotificationRulePreviewResponse sendSecurityMonitoringNotificationPreview( - CreateNotificationRuleParameters body) throws ApiException { - return sendSecurityMonitoringNotificationPreviewWithHttpInfo(body).getData(); + public UpdateCustomFrameworkResponse updateCustomFramework( + String handle, String version, UpdateCustomFrameworkRequest body) throws ApiException { + return updateCustomFrameworkWithHttpInfo(handle, version, body).getData(); } /** - * Test a notification rule. + * Update a custom framework. * - *

See {@link #sendSecurityMonitoringNotificationPreviewWithHttpInfoAsync}. + *

See {@link #updateCustomFrameworkWithHttpInfoAsync}. * + * @param handle The framework handle (required) + * @param version The framework version (required) * @param body (required) - * @return CompletableFuture<NotificationRulePreviewResponse> + * @return CompletableFuture<UpdateCustomFrameworkResponse> */ - public CompletableFuture - sendSecurityMonitoringNotificationPreviewAsync(CreateNotificationRuleParameters body) { - return sendSecurityMonitoringNotificationPreviewWithHttpInfoAsync(body) + public CompletableFuture updateCustomFrameworkAsync( + String handle, String version, UpdateCustomFrameworkRequest body) { + return updateCustomFrameworkWithHttpInfoAsync(handle, version, body) .thenApply( response -> { return response.getData(); @@ -22262,10 +25240,12 @@ public NotificationRulePreviewResponse sendSecurityMonitoringNotificationPreview } /** - * Send a notification preview to test that a notification rule's targets are properly configured. + * Update a custom framework. * + * @param handle The framework handle (required) + * @param version The framework version (required) * @param body (required) - * @return ApiResponse<NotificationRulePreviewResponse> + * @return ApiResponse<UpdateCustomFrameworkResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -22273,31 +25253,42 @@ public NotificationRulePreviewResponse sendSecurityMonitoringNotificationPreview * * * - * * + * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
500 Bad Request -
*/ - public ApiResponse - sendSecurityMonitoringNotificationPreviewWithHttpInfo(CreateNotificationRuleParameters body) - throws ApiException { + public ApiResponse updateCustomFrameworkWithHttpInfo( + String handle, String version, UpdateCustomFrameworkRequest body) throws ApiException { Object localVarPostBody = body; + // verify the required parameter 'handle' is set + if (handle == null) { + throw new ApiException( + 400, "Missing the required parameter 'handle' when calling updateCustomFramework"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException( + 400, "Missing the required parameter 'version' when calling updateCustomFramework"); + } + // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " sendSecurityMonitoringNotificationPreview"); + 400, "Missing the required parameter 'body' when calling updateCustomFramework"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/notification_rules/send_notification_preview"; + "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" + .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.sendSecurityMonitoringNotificationPreview", + "v2.SecurityMonitoringApi.updateCustomFramework", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22305,43 +25296,65 @@ public NotificationRulePreviewResponse sendSecurityMonitoringNotificationPreview new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Test a notification rule. + * Update a custom framework. * - *

See {@link #sendSecurityMonitoringNotificationPreviewWithHttpInfo}. + *

See {@link #updateCustomFrameworkWithHttpInfo}. * + * @param handle The framework handle (required) + * @param version The framework version (required) * @param body (required) - * @return CompletableFuture<ApiResponse<NotificationRulePreviewResponse>> + * @return CompletableFuture<ApiResponse<UpdateCustomFrameworkResponse>> */ - public CompletableFuture> - sendSecurityMonitoringNotificationPreviewWithHttpInfoAsync( - CreateNotificationRuleParameters body) { + public CompletableFuture> + updateCustomFrameworkWithHttpInfoAsync( + String handle, String version, UpdateCustomFrameworkRequest body) { Object localVarPostBody = body; + // verify the required parameter 'handle' is set + if (handle == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'handle' when calling updateCustomFramework")); + return result; + } + + // verify the required parameter 'version' is set + if (version == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'version' when calling updateCustomFramework")); + return result; + } + // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " sendSecurityMonitoringNotificationPreview")); + 400, "Missing the required parameter 'body' when calling updateCustomFramework")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/notification_rules/send_notification_preview"; + "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" + .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) + .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); Map localVarHeaderParams = new HashMap(); @@ -22349,7 +25362,7 @@ public NotificationRulePreviewResponse sendSecurityMonitoringNotificationPreview try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.sendSecurityMonitoringNotificationPreview", + "v2.SecurityMonitoringApi.updateCustomFramework", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22357,50 +25370,45 @@ public NotificationRulePreviewResponse sendSecurityMonitoringNotificationPreview new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Test an existing rule. + * Assign or unassign security findings. * - *

See {@link #testExistingSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #updateFindingsAssigneeWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) * @param body (required) - * @return SecurityMonitoringRuleTestResponse + * @return AssigneeResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringRuleTestResponse testExistingSecurityMonitoringRule( - String ruleId, SecurityMonitoringRuleTestRequest body) throws ApiException { - return testExistingSecurityMonitoringRuleWithHttpInfo(ruleId, body).getData(); + public AssigneeResponse updateFindingsAssignee(AssigneeRequest body) throws ApiException { + return updateFindingsAssigneeWithHttpInfo(body).getData(); } /** - * Test an existing rule. + * Assign or unassign security findings. * - *

See {@link #testExistingSecurityMonitoringRuleWithHttpInfoAsync}. + *

See {@link #updateFindingsAssigneeWithHttpInfoAsync}. * - * @param ruleId The ID of the rule. (required) * @param body (required) - * @return CompletableFuture<SecurityMonitoringRuleTestResponse> + * @return CompletableFuture<AssigneeResponse> */ - public CompletableFuture - testExistingSecurityMonitoringRuleAsync( - String ruleId, SecurityMonitoringRuleTestRequest body) { - return testExistingSecurityMonitoringRuleWithHttpInfoAsync(ruleId, body) + public CompletableFuture updateFindingsAssigneeAsync(AssigneeRequest body) { + return updateFindingsAssigneeWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -22408,53 +25416,49 @@ public SecurityMonitoringRuleTestResponse testExistingSecurityMonitoringRule( } /** - * Test an existing rule. + * Assign or unassign security findings. You can assign up to 100 security findings per request. + * Set assignee_id to the unique identifier of the Datadog user you want to assign + * the findings to. Omit assignee_id (or set it to null) to unassign the + * findings. Per-finding warnings and failures are returned in the response meta + * object. * - * @param ruleId The ID of the rule. (required) * @param body (required) - * @return ApiResponse<SecurityMonitoringRuleTestResponse> + * @return ApiResponse<AssigneeResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * - * * * *
Response details
Status Code Description Response Headers
200 OK -
202 Accepted -
400 Bad Request -
401 Concurrent Modification -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse - testExistingSecurityMonitoringRuleWithHttpInfo( - String ruleId, SecurityMonitoringRuleTestRequest body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'ruleId' is set - if (ruleId == null) { - throw new ApiException( - 400, - "Missing the required parameter 'ruleId' when calling" - + " testExistingSecurityMonitoringRule"); + public ApiResponse updateFindingsAssigneeWithHttpInfo(AssigneeRequest body) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateFindingsAssignee"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); } + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, - "Missing the required parameter 'body' when calling testExistingSecurityMonitoringRule"); + 400, "Missing the required parameter 'body' when calling updateFindingsAssignee"); } // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}/test" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + String localVarPath = "/api/v2/security/findings/assignee"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.testExistingSecurityMonitoringRule", + "v2.SecurityMonitoringApi.updateFindingsAssignee", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22462,57 +25466,48 @@ public SecurityMonitoringRuleTestResponse testExistingSecurityMonitoringRule( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "PATCH", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Test an existing rule. + * Assign or unassign security findings. * - *

See {@link #testExistingSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #updateFindingsAssigneeWithHttpInfo}. * - * @param ruleId The ID of the rule. (required) * @param body (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleTestResponse>> + * @return CompletableFuture<ApiResponse<AssigneeResponse>> */ - public CompletableFuture> - testExistingSecurityMonitoringRuleWithHttpInfoAsync( - String ruleId, SecurityMonitoringRuleTestRequest body) { - Object localVarPostBody = body; - - // verify the required parameter 'ruleId' is set - if (ruleId == null) { - CompletableFuture> result = - new CompletableFuture<>(); + public CompletableFuture> updateFindingsAssigneeWithHttpInfoAsync( + AssigneeRequest body) { + // Check if unstable operation is enabled + String operationId = "updateFindingsAssignee"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'ruleId' when calling" - + " testExistingSecurityMonitoringRule")); + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } + Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " testExistingSecurityMonitoringRule")); + 400, "Missing the required parameter 'body' when calling updateFindingsAssignee")); return result; } // create path and map variables - String localVarPath = - "/api/v2/security_monitoring/rules/{rule_id}/test" - .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); + String localVarPath = "/api/v2/security/findings/assignee"; Map localVarHeaderParams = new HashMap(); @@ -22520,7 +25515,7 @@ public SecurityMonitoringRuleTestResponse testExistingSecurityMonitoringRule( try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.testExistingSecurityMonitoringRule", + "v2.SecurityMonitoringApi.updateFindingsAssignee", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22528,47 +25523,46 @@ public SecurityMonitoringRuleTestResponse testExistingSecurityMonitoringRule( new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "PATCH", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Test a rule. + * Update resource filters. * - *

See {@link #testSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #updateResourceEvaluationFiltersWithHttpInfo}. * * @param body (required) - * @return SecurityMonitoringRuleTestResponse + * @return UpdateResourceEvaluationFiltersResponse * @throws ApiException if fails to make API call */ - public SecurityMonitoringRuleTestResponse testSecurityMonitoringRule( - SecurityMonitoringRuleTestRequest body) throws ApiException { - return testSecurityMonitoringRuleWithHttpInfo(body).getData(); + public UpdateResourceEvaluationFiltersResponse updateResourceEvaluationFilters( + UpdateResourceEvaluationFiltersRequest body) throws ApiException { + return updateResourceEvaluationFiltersWithHttpInfo(body).getData(); } /** - * Test a rule. + * Update resource filters. * - *

See {@link #testSecurityMonitoringRuleWithHttpInfoAsync}. + *

See {@link #updateResourceEvaluationFiltersWithHttpInfoAsync}. * * @param body (required) - * @return CompletableFuture<SecurityMonitoringRuleTestResponse> + * @return CompletableFuture<UpdateResourceEvaluationFiltersResponse> */ - public CompletableFuture testSecurityMonitoringRuleAsync( - SecurityMonitoringRuleTestRequest body) { - return testSecurityMonitoringRuleWithHttpInfoAsync(body) + public CompletableFuture + updateResourceEvaluationFiltersAsync(UpdateResourceEvaluationFiltersRequest body) { + return updateResourceEvaluationFiltersWithHttpInfoAsync(body) .thenApply( response -> { return response.getData(); @@ -22576,40 +25570,40 @@ public CompletableFuture testSecurityMonitor } /** - * Test a rule. + * Update resource filters. * * @param body (required) - * @return ApiResponse<SecurityMonitoringRuleTestResponse> + * @return ApiResponse<UpdateResourceEvaluationFiltersResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * * - * * *
Response details
Status Code Description Response Headers
200 OK -
201 OK -
400 Bad Request -
401 Concurrent Modification -
403 Not Authorized -
404 Not Found -
429 Too many requests -
*/ - public ApiResponse testSecurityMonitoringRuleWithHttpInfo( - SecurityMonitoringRuleTestRequest body) throws ApiException { + public ApiResponse + updateResourceEvaluationFiltersWithHttpInfo(UpdateResourceEvaluationFiltersRequest 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 testSecurityMonitoringRule"); + 400, + "Missing the required parameter 'body' when calling updateResourceEvaluationFilters"); } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules/test"; + String localVarPath = "/api/v2/cloud_security_management/resource_filters"; Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.testSecurityMonitoringRule", + "v2.SecurityMonitoringApi.updateResourceEvaluationFilters", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22617,40 +25611,42 @@ public ApiResponse testSecurityMonitoringRul new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Test a rule. + * Update resource filters. * - *

See {@link #testSecurityMonitoringRuleWithHttpInfo}. + *

See {@link #updateResourceEvaluationFiltersWithHttpInfo}. * * @param body (required) - * @return CompletableFuture<ApiResponse<SecurityMonitoringRuleTestResponse>> + * @return CompletableFuture<ApiResponse<UpdateResourceEvaluationFiltersResponse>> */ - public CompletableFuture> - testSecurityMonitoringRuleWithHttpInfoAsync(SecurityMonitoringRuleTestRequest body) { + public CompletableFuture> + updateResourceEvaluationFiltersWithHttpInfoAsync( + UpdateResourceEvaluationFiltersRequest body) { Object localVarPostBody = body; // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'body' when calling testSecurityMonitoringRule")); + "Missing the required parameter 'body' when calling" + + " updateResourceEvaluationFilters")); return result; } // create path and map variables - String localVarPath = "/api/v2/security_monitoring/rules/test"; + String localVarPath = "/api/v2/cloud_security_management/resource_filters"; Map localVarHeaderParams = new HashMap(); @@ -22658,7 +25654,7 @@ public ApiResponse testSecurityMonitoringRul try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.testSecurityMonitoringRule", + "v2.SecurityMonitoringApi.updateResourceEvaluationFilters", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22666,51 +25662,49 @@ public ApiResponse testSecurityMonitoringRul new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "POST", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Update a custom framework. + * Update a security filter. * - *

See {@link #updateCustomFrameworkWithHttpInfo}. + *

See {@link #updateSecurityFilterWithHttpInfo}. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @param body (required) - * @return UpdateCustomFrameworkResponse + * @param securityFilterId The ID of the security filter. (required) + * @param body New definition of the security filter. (required) + * @return SecurityFilterResponse * @throws ApiException if fails to make API call */ - public UpdateCustomFrameworkResponse updateCustomFramework( - String handle, String version, UpdateCustomFrameworkRequest body) throws ApiException { - return updateCustomFrameworkWithHttpInfo(handle, version, body).getData(); + public SecurityFilterResponse updateSecurityFilter( + String securityFilterId, SecurityFilterUpdateRequest body) throws ApiException { + return updateSecurityFilterWithHttpInfo(securityFilterId, body).getData(); } /** - * Update a custom framework. + * Update a security filter. * - *

See {@link #updateCustomFrameworkWithHttpInfoAsync}. + *

See {@link #updateSecurityFilterWithHttpInfoAsync}. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @param body (required) - * @return CompletableFuture<UpdateCustomFrameworkResponse> + * @param securityFilterId The ID of the security filter. (required) + * @param body New definition of the security filter. (required) + * @return CompletableFuture<SecurityFilterResponse> */ - public CompletableFuture updateCustomFrameworkAsync( - String handle, String version, UpdateCustomFrameworkRequest body) { - return updateCustomFrameworkWithHttpInfoAsync(handle, version, body) + public CompletableFuture updateSecurityFilterAsync( + String securityFilterId, SecurityFilterUpdateRequest body) { + return updateSecurityFilterWithHttpInfoAsync(securityFilterId, body) .thenApply( response -> { return response.getData(); @@ -22718,12 +25712,12 @@ public CompletableFuture updateCustomFrameworkAsy } /** - * Update a custom framework. + * Update a specific security filter. Returns the security filter object when the request is + * successful. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @param body (required) - * @return ApiResponse<UpdateCustomFrameworkResponse> + * @param securityFilterId The ID of the security filter. (required) + * @param body New definition of the security filter. (required) + * @return ApiResponse<SecurityFilterResponse> * @throws ApiException if fails to make API call * @http.response.details * @@ -22731,42 +25725,40 @@ public CompletableFuture updateCustomFrameworkAsy * * * + * + * + * * - * *
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
409 Concurrent Modification -
429 Too many requests -
500 Bad Request -
*/ - public ApiResponse updateCustomFrameworkWithHttpInfo( - String handle, String version, UpdateCustomFrameworkRequest body) throws ApiException { + public ApiResponse updateSecurityFilterWithHttpInfo( + String securityFilterId, SecurityFilterUpdateRequest body) throws ApiException { Object localVarPostBody = body; - // verify the required parameter 'handle' is set - if (handle == null) { - throw new ApiException( - 400, "Missing the required parameter 'handle' when calling updateCustomFramework"); - } - - // verify the required parameter 'version' is set - if (version == null) { + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { throw new ApiException( - 400, "Missing the required parameter 'version' when calling updateCustomFramework"); + 400, + "Missing the required parameter 'securityFilterId' when calling updateSecurityFilter"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling updateCustomFramework"); + 400, "Missing the required parameter 'body' when calling updateSecurityFilter"); } // create path and map variables String localVarPath = - "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" - .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" + .replaceAll( + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.updateCustomFramework", + "v2.SecurityMonitoringApi.updateSecurityFilter", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22774,65 +25766,55 @@ public ApiResponse updateCustomFrameworkWithHttpI new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); return apiClient.invokeAPI( - "PUT", + "PATCH", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Update a custom framework. + * Update a security filter. * - *

See {@link #updateCustomFrameworkWithHttpInfo}. + *

See {@link #updateSecurityFilterWithHttpInfo}. * - * @param handle The framework handle (required) - * @param version The framework version (required) - * @param body (required) - * @return CompletableFuture<ApiResponse<UpdateCustomFrameworkResponse>> + * @param securityFilterId The ID of the security filter. (required) + * @param body New definition of the security filter. (required) + * @return CompletableFuture<ApiResponse<SecurityFilterResponse>> */ - public CompletableFuture> - updateCustomFrameworkWithHttpInfoAsync( - String handle, String version, UpdateCustomFrameworkRequest body) { + public CompletableFuture> + updateSecurityFilterWithHttpInfoAsync( + String securityFilterId, SecurityFilterUpdateRequest body) { Object localVarPostBody = body; - // verify the required parameter 'handle' is set - if (handle == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, "Missing the required parameter 'handle' when calling updateCustomFramework")); - return result; - } - - // verify the required parameter 'version' is set - if (version == null) { - CompletableFuture> result = - new CompletableFuture<>(); + // verify the required parameter 'securityFilterId' is set + if (securityFilterId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'version' when calling updateCustomFramework")); + 400, + "Missing the required parameter 'securityFilterId' when calling" + + " updateSecurityFilter")); return result; } // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling updateCustomFramework")); + 400, "Missing the required parameter 'body' when calling updateSecurityFilter")); return result; } // create path and map variables String localVarPath = - "/api/v2/cloud_security_management/custom_frameworks/{handle}/{version}" - .replaceAll("\\{" + "handle" + "\\}", apiClient.escapeString(handle.toString())) - .replaceAll("\\{" + "version" + "\\}", apiClient.escapeString(version.toString())); + "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" + .replaceAll( + "\\{" + "security_filter_id" + "\\}", + apiClient.escapeString(securityFilterId.toString())); Map localVarHeaderParams = new HashMap(); @@ -22840,7 +25822,7 @@ public ApiResponse updateCustomFrameworkWithHttpI try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.updateCustomFramework", + "v2.SecurityMonitoringApi.updateSecurityFilter", localVarPath, new ArrayList(), localVarHeaderParams, @@ -22848,45 +25830,48 @@ public ApiResponse updateCustomFrameworkWithHttpI new String[] {"application/json"}, new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PUT", + "PATCH", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Assign or unassign security findings. + * Update a due date rule. * - *

See {@link #updateFindingsAssigneeWithHttpInfo}. + *

See {@link #updateSecurityFindingsAutomationDueDateRuleWithHttpInfo}. * + * @param ruleId The ID of the due date rule. (required) * @param body (required) - * @return AssigneeResponse + * @return DueDateRuleResponse * @throws ApiException if fails to make API call */ - public AssigneeResponse updateFindingsAssignee(AssigneeRequest body) throws ApiException { - return updateFindingsAssigneeWithHttpInfo(body).getData(); + public DueDateRuleResponse updateSecurityFindingsAutomationDueDateRule( + UUID ruleId, DueDateRuleUpdateRequest body) throws ApiException { + return updateSecurityFindingsAutomationDueDateRuleWithHttpInfo(ruleId, body).getData(); } /** - * Assign or unassign security findings. + * Update a due date rule. * - *

See {@link #updateFindingsAssigneeWithHttpInfoAsync}. + *

See {@link #updateSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync}. * + * @param ruleId The ID of the due date rule. (required) * @param body (required) - * @return CompletableFuture<AssigneeResponse> + * @return CompletableFuture<DueDateRuleResponse> */ - public CompletableFuture updateFindingsAssigneeAsync(AssigneeRequest body) { - return updateFindingsAssigneeWithHttpInfoAsync(body) + public CompletableFuture updateSecurityFindingsAutomationDueDateRuleAsync( + UUID ruleId, DueDateRuleUpdateRequest body) { + return updateSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync(ruleId, body) .thenApply( response -> { return response.getData(); @@ -22894,29 +25879,28 @@ public CompletableFuture updateFindingsAssigneeAsync(AssigneeR } /** - * Assign or unassign security findings. You can assign up to 100 security findings per request. - * Set assignee_id to the unique identifier of the Datadog user you want to assign - * the findings to. Omit assignee_id (or set it to null) to unassign the - * findings. Per-finding warnings and failures are returned in the response meta - * object. + * Update an existing due date rule by ID. * + * @param ruleId The ID of the due date rule. (required) * @param body (required) - * @return ApiResponse<AssigneeResponse> + * @return ApiResponse<DueDateRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * + * * + * * *
Response details
Status Code Description Response Headers
202 Accepted -
200 Successfully updated the due date rule -
400 Bad Request -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
429 Too many requests -
*/ - public ApiResponse updateFindingsAssigneeWithHttpInfo(AssigneeRequest body) - throws ApiException { + public ApiResponse updateSecurityFindingsAutomationDueDateRuleWithHttpInfo( + UUID ruleId, DueDateRuleUpdateRequest body) throws ApiException { // Check if unstable operation is enabled - String operationId = "updateFindingsAssignee"; + String operationId = "updateSecurityFindingsAutomationDueDateRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { @@ -22924,68 +25908,97 @@ public ApiResponse updateFindingsAssigneeWithHttpInfo(Assignee } Object localVarPostBody = body; + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling" + + " updateSecurityFindingsAutomationDueDateRule"); + } + // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling updateFindingsAssignee"); + 400, + "Missing the required parameter 'body' when calling" + + " updateSecurityFindingsAutomationDueDateRule"); } // create path and map variables - String localVarPath = "/api/v2/security/findings/assignee"; + String localVarPath = + "/api/v2/security/findings/automation/due_date_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.updateFindingsAssignee", + "v2.SecurityMonitoringApi.updateSecurityFindingsAutomationDueDateRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "PATCH", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Assign or unassign security findings. + * Update a due date rule. * - *

See {@link #updateFindingsAssigneeWithHttpInfo}. + *

See {@link #updateSecurityFindingsAutomationDueDateRuleWithHttpInfo}. * + * @param ruleId The ID of the due date rule. (required) * @param body (required) - * @return CompletableFuture<ApiResponse<AssigneeResponse>> + * @return CompletableFuture<ApiResponse<DueDateRuleResponse>> */ - public CompletableFuture> updateFindingsAssigneeWithHttpInfoAsync( - AssigneeRequest body) { + public CompletableFuture> + updateSecurityFindingsAutomationDueDateRuleWithHttpInfoAsync( + UUID ruleId, DueDateRuleUpdateRequest body) { // Check if unstable operation is enabled - String operationId = "updateFindingsAssignee"; + String operationId = "updateSecurityFindingsAutomationDueDateRule"; if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); } else { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); return result; } Object localVarPostBody = body; + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling" + + " updateSecurityFindingsAutomationDueDateRule")); + return result; + } + // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling updateFindingsAssignee")); + 400, + "Missing the required parameter 'body' when calling" + + " updateSecurityFindingsAutomationDueDateRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/security/findings/assignee"; + String localVarPath = + "/api/v2/security/findings/automation/due_date_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -22993,54 +26006,56 @@ public CompletableFuture> updateFindingsAssigneeWi try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.updateFindingsAssignee", + "v2.SecurityMonitoringApi.updateSecurityFindingsAutomationDueDateRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Update resource filters. + * Update a mute rule. * - *

See {@link #updateResourceEvaluationFiltersWithHttpInfo}. + *

See {@link #updateSecurityFindingsAutomationMuteRuleWithHttpInfo}. * + * @param ruleId The ID of the mute rule. (required) * @param body (required) - * @return UpdateResourceEvaluationFiltersResponse + * @return MuteRuleResponse * @throws ApiException if fails to make API call */ - public UpdateResourceEvaluationFiltersResponse updateResourceEvaluationFilters( - UpdateResourceEvaluationFiltersRequest body) throws ApiException { - return updateResourceEvaluationFiltersWithHttpInfo(body).getData(); + public MuteRuleResponse updateSecurityFindingsAutomationMuteRule( + UUID ruleId, MuteRuleUpdateRequest body) throws ApiException { + return updateSecurityFindingsAutomationMuteRuleWithHttpInfo(ruleId, body).getData(); } /** - * Update resource filters. + * Update a mute rule. * - *

See {@link #updateResourceEvaluationFiltersWithHttpInfoAsync}. + *

See {@link #updateSecurityFindingsAutomationMuteRuleWithHttpInfoAsync}. * + * @param ruleId The ID of the mute rule. (required) * @param body (required) - * @return CompletableFuture<UpdateResourceEvaluationFiltersResponse> + * @return CompletableFuture<MuteRuleResponse> */ - public CompletableFuture - updateResourceEvaluationFiltersAsync(UpdateResourceEvaluationFiltersRequest body) { - return updateResourceEvaluationFiltersWithHttpInfoAsync(body) + public CompletableFuture updateSecurityFindingsAutomationMuteRuleAsync( + UUID ruleId, MuteRuleUpdateRequest body) { + return updateSecurityFindingsAutomationMuteRuleWithHttpInfoAsync(ruleId, body) .thenApply( response -> { return response.getData(); @@ -23048,46 +26063,66 @@ public UpdateResourceEvaluationFiltersResponse updateResourceEvaluationFilters( } /** - * Update resource filters. + * Update an existing mute rule by ID. * + * @param ruleId The ID of the mute rule. (required) * @param body (required) - * @return ApiResponse<UpdateResourceEvaluationFiltersResponse> + * @return ApiResponse<MuteRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * + * + * * *
Response details
Status Code Description Response Headers
201 OK -
200 Successfully updated the mute rule -
400 Bad Request -
403 Not Authorized -
403 Forbidden -
404 Not Found -
422 Unprocessable Entity -
429 Too many requests -
*/ - public ApiResponse - updateResourceEvaluationFiltersWithHttpInfo(UpdateResourceEvaluationFiltersRequest body) - throws ApiException { + public ApiResponse updateSecurityFindingsAutomationMuteRuleWithHttpInfo( + UUID ruleId, MuteRuleUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateSecurityFindingsAutomationMuteRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling" + + " updateSecurityFindingsAutomationMuteRule"); + } + // verify the required parameter 'body' is set if (body == null) { throw new ApiException( 400, - "Missing the required parameter 'body' when calling updateResourceEvaluationFilters"); + "Missing the required parameter 'body' when calling" + + " updateSecurityFindingsAutomationMuteRule"); } // create path and map variables - String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + String localVarPath = + "/api/v2/security/findings/automation/mute_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.updateResourceEvaluationFilters", + "v2.SecurityMonitoringApi.updateSecurityFindingsAutomationMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( "PUT", builder, @@ -23096,35 +26131,58 @@ public UpdateResourceEvaluationFiltersResponse updateResourceEvaluationFilters( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Update resource filters. + * Update a mute rule. * - *

See {@link #updateResourceEvaluationFiltersWithHttpInfo}. + *

See {@link #updateSecurityFindingsAutomationMuteRuleWithHttpInfo}. * + * @param ruleId The ID of the mute rule. (required) * @param body (required) - * @return CompletableFuture<ApiResponse<UpdateResourceEvaluationFiltersResponse>> + * @return CompletableFuture<ApiResponse<MuteRuleResponse>> */ - public CompletableFuture> - updateResourceEvaluationFiltersWithHttpInfoAsync( - UpdateResourceEvaluationFiltersRequest body) { + public CompletableFuture> + updateSecurityFindingsAutomationMuteRuleWithHttpInfoAsync( + UUID ruleId, MuteRuleUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateSecurityFindingsAutomationMuteRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'ruleId' when calling" + + " updateSecurityFindingsAutomationMuteRule")); + return result; + } + // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, "Missing the required parameter 'body' when calling" - + " updateResourceEvaluationFilters")); + + " updateSecurityFindingsAutomationMuteRule")); return result; } // create path and map variables - String localVarPath = "/api/v2/cloud_security_management/resource_filters"; + String localVarPath = + "/api/v2/security/findings/automation/mute_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -23132,16 +26190,15 @@ public UpdateResourceEvaluationFiltersResponse updateResourceEvaluationFilters( try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.updateResourceEvaluationFilters", + "v2.SecurityMonitoringApi.updateSecurityFindingsAutomationMuteRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } @@ -23153,36 +26210,37 @@ public UpdateResourceEvaluationFiltersResponse updateResourceEvaluationFilters( localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Update a security filter. + * Update a ticket creation rule. * - *

See {@link #updateSecurityFilterWithHttpInfo}. + *

See {@link #updateSecurityFindingsAutomationTicketCreationRuleWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) - * @param body New definition of the security filter. (required) - * @return SecurityFilterResponse + * @param ruleId The ID of the ticket creation rule. (required) + * @param body (required) + * @return TicketCreationRuleResponse * @throws ApiException if fails to make API call */ - public SecurityFilterResponse updateSecurityFilter( - String securityFilterId, SecurityFilterUpdateRequest body) throws ApiException { - return updateSecurityFilterWithHttpInfo(securityFilterId, body).getData(); + public TicketCreationRuleResponse updateSecurityFindingsAutomationTicketCreationRule( + UUID ruleId, TicketCreationRuleUpdateRequest body) throws ApiException { + return updateSecurityFindingsAutomationTicketCreationRuleWithHttpInfo(ruleId, body).getData(); } /** - * Update a security filter. + * Update a ticket creation rule. * - *

See {@link #updateSecurityFilterWithHttpInfoAsync}. + *

See {@link #updateSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync}. * - * @param securityFilterId The ID of the security filter. (required) - * @param body New definition of the security filter. (required) - * @return CompletableFuture<SecurityFilterResponse> + * @param ruleId The ID of the ticket creation rule. (required) + * @param body (required) + * @return CompletableFuture<TicketCreationRuleResponse> */ - public CompletableFuture updateSecurityFilterAsync( - String securityFilterId, SecurityFilterUpdateRequest body) { - return updateSecurityFilterWithHttpInfoAsync(securityFilterId, body) + public CompletableFuture + updateSecurityFindingsAutomationTicketCreationRuleAsync( + UUID ruleId, TicketCreationRuleUpdateRequest body) { + return updateSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync(ruleId, body) .thenApply( response -> { return response.getData(); @@ -23190,109 +26248,127 @@ public CompletableFuture updateSecurityFilterAsync( } /** - * Update a specific security filter. Returns the security filter object when the request is - * successful. + * Update an existing ticket creation rule by ID. * - * @param securityFilterId The ID of the security filter. (required) - * @param body New definition of the security filter. (required) - * @return ApiResponse<SecurityFilterResponse> + * @param ruleId The ID of the ticket creation rule. (required) + * @param body (required) + * @return ApiResponse<TicketCreationRuleResponse> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * - * + * * - * + * * *
Response details
Status Code Description Response Headers
200 OK -
200 Successfully updated the ticket creation rule -
400 Bad Request -
403 Not Authorized -
403 Forbidden -
404 Not Found -
409 Concurrent Modification -
422 Unprocessable Entity -
429 Too many requests -
*/ - public ApiResponse updateSecurityFilterWithHttpInfo( - String securityFilterId, SecurityFilterUpdateRequest body) throws ApiException { + public ApiResponse + updateSecurityFindingsAutomationTicketCreationRuleWithHttpInfo( + UUID ruleId, TicketCreationRuleUpdateRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "updateSecurityFindingsAutomationTicketCreationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } Object localVarPostBody = body; - // verify the required parameter 'securityFilterId' is set - if (securityFilterId == null) { + // verify the required parameter 'ruleId' is set + if (ruleId == null) { throw new ApiException( 400, - "Missing the required parameter 'securityFilterId' when calling updateSecurityFilter"); + "Missing the required parameter 'ruleId' when calling" + + " updateSecurityFindingsAutomationTicketCreationRule"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException( - 400, "Missing the required parameter 'body' when calling updateSecurityFilter"); + 400, + "Missing the required parameter 'body' when calling" + + " updateSecurityFindingsAutomationTicketCreationRule"); } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + "/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); Invocation.Builder builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.updateSecurityFilter", + "v2.SecurityMonitoringApi.updateSecurityFindingsAutomationTicketCreationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); return apiClient.invokeAPI( - "PATCH", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** - * Update a security filter. + * Update a ticket creation rule. * - *

See {@link #updateSecurityFilterWithHttpInfo}. + *

See {@link #updateSecurityFindingsAutomationTicketCreationRuleWithHttpInfo}. * - * @param securityFilterId The ID of the security filter. (required) - * @param body New definition of the security filter. (required) - * @return CompletableFuture<ApiResponse<SecurityFilterResponse>> + * @param ruleId The ID of the ticket creation rule. (required) + * @param body (required) + * @return CompletableFuture<ApiResponse<TicketCreationRuleResponse>> */ - public CompletableFuture> - updateSecurityFilterWithHttpInfoAsync( - String securityFilterId, SecurityFilterUpdateRequest body) { + public CompletableFuture> + updateSecurityFindingsAutomationTicketCreationRuleWithHttpInfoAsync( + UUID ruleId, TicketCreationRuleUpdateRequest body) { + // Check if unstable operation is enabled + String operationId = "updateSecurityFindingsAutomationTicketCreationRule"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } Object localVarPostBody = body; - // verify the required parameter 'securityFilterId' is set - if (securityFilterId == null) { - CompletableFuture> result = new CompletableFuture<>(); + // verify the required parameter 'ruleId' is set + if (ruleId == null) { + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( 400, - "Missing the required parameter 'securityFilterId' when calling" - + " updateSecurityFilter")); + "Missing the required parameter 'ruleId' when calling" + + " updateSecurityFindingsAutomationTicketCreationRule")); return result; } // verify the required parameter 'body' is set if (body == null) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally( new ApiException( - 400, "Missing the required parameter 'body' when calling updateSecurityFilter")); + 400, + "Missing the required parameter 'body' when calling" + + " updateSecurityFindingsAutomationTicketCreationRule")); return result; } // create path and map variables String localVarPath = - "/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}" - .replaceAll( - "\\{" + "security_filter_id" + "\\}", - apiClient.escapeString(securityFilterId.toString())); + "/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}" + .replaceAll("\\{" + "rule_id" + "\\}", apiClient.escapeString(ruleId.toString())); Map localVarHeaderParams = new HashMap(); @@ -23300,27 +26376,27 @@ public ApiResponse updateSecurityFilterWithHttpInfo( try { builder = apiClient.createBuilder( - "v2.SecurityMonitoringApi.updateSecurityFilter", + "v2.SecurityMonitoringApi.updateSecurityFindingsAutomationTicketCreationRule", localVarPath, new ArrayList(), localVarHeaderParams, new HashMap(), new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + new String[] {"apiKeyAuth", "appKeyAuth"}); } catch (ApiException ex) { - CompletableFuture> result = new CompletableFuture<>(); + CompletableFuture> result = new CompletableFuture<>(); result.completeExceptionally(ex); return result; } return apiClient.invokeAPIAsync( - "PATCH", + "PUT", builder, localVarHeaderParams, new String[] {"application/json"}, localVarPostBody, new HashMap(), false, - new GenericType() {}); + new GenericType() {}); } /** diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleActorType.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleActorType.java new file mode 100644 index 00000000000..bca713004ec --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleActorType.java @@ -0,0 +1,57 @@ +/* + * 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; + +/** Whether the actor is a user or the Datadog system. */ +@JsonSerialize(using = AutomationRuleActorType.AutomationRuleActorTypeSerializer.class) +public class AutomationRuleActorType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("user", "system")); + + public static final AutomationRuleActorType USER = new AutomationRuleActorType("user"); + public static final AutomationRuleActorType SYSTEM = new AutomationRuleActorType("system"); + + AutomationRuleActorType(String value) { + super(value, allowedValues); + } + + public static class AutomationRuleActorTypeSerializer + extends StdSerializer { + public AutomationRuleActorTypeSerializer(Class t) { + super(t); + } + + public AutomationRuleActorTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AutomationRuleActorType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AutomationRuleActorType fromValue(String value) { + return new AutomationRuleActorType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreatedBy.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreatedBy.java new file mode 100644 index 00000000000..c51ec2bf84e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleCreatedBy.java @@ -0,0 +1,206 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The user or Datadog system who created the rule. */ +@JsonPropertyOrder({ + AutomationRuleCreatedBy.JSON_PROPERTY_ID, + AutomationRuleCreatedBy.JSON_PROPERTY_NAME, + AutomationRuleCreatedBy.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleCreatedBy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AutomationRuleActorType type; + + public AutomationRuleCreatedBy() {} + + @JsonCreator + public AutomationRuleCreatedBy( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AutomationRuleActorType type) { + this.id = id; + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AutomationRuleCreatedBy id(String id) { + this.id = id; + return this; + } + + /** + * The actor's identifier (a user UUID or a system identifier). + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AutomationRuleCreatedBy name(String name) { + this.name = name; + return this; + } + + /** + * The name of the actor. + * + * @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 AutomationRuleCreatedBy type(AutomationRuleActorType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Whether the actor is a user or the Datadog system. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleActorType getType() { + return type; + } + + public void setType(AutomationRuleActorType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleCreatedBy + */ + @JsonAnySetter + public AutomationRuleCreatedBy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleCreatedBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleCreatedBy automationRuleCreatedBy = (AutomationRuleCreatedBy) o; + return Objects.equals(this.id, automationRuleCreatedBy.id) + && Objects.equals(this.name, automationRuleCreatedBy.name) + && Objects.equals(this.type, automationRuleCreatedBy.type) + && Objects.equals(this.additionalProperties, automationRuleCreatedBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleCreatedBy {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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/AutomationRuleModifiedBy.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleModifiedBy.java new file mode 100644 index 00000000000..54aba32b79d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleModifiedBy.java @@ -0,0 +1,206 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The user or Datadog system who last modified the rule. */ +@JsonPropertyOrder({ + AutomationRuleModifiedBy.JSON_PROPERTY_ID, + AutomationRuleModifiedBy.JSON_PROPERTY_NAME, + AutomationRuleModifiedBy.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleModifiedBy { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AutomationRuleActorType type; + + public AutomationRuleModifiedBy() {} + + @JsonCreator + public AutomationRuleModifiedBy( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) AutomationRuleActorType type) { + this.id = id; + this.name = name; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AutomationRuleModifiedBy id(String id) { + this.id = id; + return this; + } + + /** + * The actor's identifier (a user UUID or a system identifier). + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public AutomationRuleModifiedBy name(String name) { + this.name = name; + return this; + } + + /** + * The name of the actor. + * + * @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 AutomationRuleModifiedBy type(AutomationRuleActorType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Whether the actor is a user or the Datadog system. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleActorType getType() { + return type; + } + + public void setType(AutomationRuleActorType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleModifiedBy + */ + @JsonAnySetter + public AutomationRuleModifiedBy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleModifiedBy object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleModifiedBy automationRuleModifiedBy = (AutomationRuleModifiedBy) o; + return Objects.equals(this.id, automationRuleModifiedBy.id) + && Objects.equals(this.name, automationRuleModifiedBy.name) + && Objects.equals(this.type, automationRuleModifiedBy.type) + && Objects.equals(this.additionalProperties, automationRuleModifiedBy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleModifiedBy {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).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/AutomationRuleScope.java b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleScope.java new file mode 100644 index 00000000000..178cd1eb70b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AutomationRuleScope.java @@ -0,0 +1,185 @@ +/* + * 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; + +/** Defines the scope of findings to which the automation rule applies. */ +@JsonPropertyOrder({ + AutomationRuleScope.JSON_PROPERTY_FINDING_TYPES, + AutomationRuleScope.JSON_PROPERTY_QUERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AutomationRuleScope { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FINDING_TYPES = "finding_types"; + private List findingTypes = new ArrayList<>(); + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public AutomationRuleScope() {} + + @JsonCreator + public AutomationRuleScope( + @JsonProperty(required = true, value = JSON_PROPERTY_FINDING_TYPES) + List findingTypes) { + this.findingTypes = findingTypes; + } + + public AutomationRuleScope findingTypes(List findingTypes) { + this.findingTypes = findingTypes; + return this; + } + + public AutomationRuleScope addFindingTypesItem(SecurityFindingType findingTypesItem) { + this.findingTypes.add(findingTypesItem); + this.unparsed |= !findingTypesItem.isValid(); + return this; + } + + /** + * The list of security finding types that the automation rule applies to. + * + * @return findingTypes + */ + @JsonProperty(JSON_PROPERTY_FINDING_TYPES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getFindingTypes() { + return findingTypes; + } + + public void setFindingTypes(List findingTypes) { + this.findingTypes = findingTypes; + } + + public AutomationRuleScope query(String query) { + this.query = query; + return this; + } + + /** + * A search query to further filter the findings matched by this rule. The @workflow.* + * namespace and @status fields are not permitted. For a reference of + * available fields, see the Security Findings schema + * documentation. + * + * @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; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return AutomationRuleScope + */ + @JsonAnySetter + public AutomationRuleScope putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AutomationRuleScope object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AutomationRuleScope automationRuleScope = (AutomationRuleScope) o; + return Objects.equals(this.findingTypes, automationRuleScope.findingTypes) + && Objects.equals(this.query, automationRuleScope.query) + && Objects.equals(this.additionalProperties, automationRuleScope.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(findingTypes, query, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AutomationRuleScope {\n"); + sb.append(" findingTypes: ").append(toIndentedString(findingTypes)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).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/DueDateFrom.java b/src/main/java/com/datadog/api/client/v2/model/DueDateFrom.java new file mode 100644 index 00000000000..1ca884baf17 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateFrom.java @@ -0,0 +1,58 @@ +/* + * 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 reference point from which the due date is calculated. When fix_available is + * selected but not applicable to the finding type, first_seen is used instead. + */ +@JsonSerialize(using = DueDateFrom.DueDateFromSerializer.class) +public class DueDateFrom extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("first_seen", "fix_available")); + + public static final DueDateFrom FIRST_SEEN = new DueDateFrom("first_seen"); + public static final DueDateFrom FIX_AVAILABLE = new DueDateFrom("fix_available"); + + DueDateFrom(String value) { + super(value, allowedValues); + } + + public static class DueDateFromSerializer extends StdSerializer { + public DueDateFromSerializer(Class t) { + super(t); + } + + public DueDateFromSerializer() { + this(null); + } + + @Override + public void serialize(DueDateFrom value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DueDateFrom fromValue(String value) { + return new DueDateFrom(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DueDatePerSeverityItem.java b/src/main/java/com/datadog/api/client/v2/model/DueDatePerSeverityItem.java new file mode 100644 index 00000000000..012abd68475 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDatePerSeverityItem.java @@ -0,0 +1,178 @@ +/* + * 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; + +/** A mapping of a severity level to the number of days until a finding is due. */ +@JsonPropertyOrder({ + DueDatePerSeverityItem.JSON_PROPERTY_DUE_IN_DAYS, + DueDatePerSeverityItem.JSON_PROPERTY_SEVERITY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDatePerSeverityItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DUE_IN_DAYS = "due_in_days"; + private Long dueInDays; + + public static final String JSON_PROPERTY_SEVERITY = "severity"; + private DueDateSeverity severity; + + public DueDatePerSeverityItem() {} + + @JsonCreator + public DueDatePerSeverityItem( + @JsonProperty(required = true, value = JSON_PROPERTY_DUE_IN_DAYS) Long dueInDays, + @JsonProperty(required = true, value = JSON_PROPERTY_SEVERITY) DueDateSeverity severity) { + this.dueInDays = dueInDays; + this.severity = severity; + this.unparsed |= !severity.isValid(); + } + + public DueDatePerSeverityItem dueInDays(Long dueInDays) { + this.dueInDays = dueInDays; + return this; + } + + /** + * The number of days from the reference point until the finding is due. minimum: 1 maximum: 365 + * + * @return dueInDays + */ + @JsonProperty(JSON_PROPERTY_DUE_IN_DAYS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getDueInDays() { + return dueInDays; + } + + public void setDueInDays(Long dueInDays) { + this.dueInDays = dueInDays; + } + + public DueDatePerSeverityItem severity(DueDateSeverity severity) { + this.severity = severity; + this.unparsed |= !severity.isValid(); + return this; + } + + /** + * A severity level used to configure due date thresholds. + * + * @return severity + */ + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateSeverity getSeverity() { + return severity; + } + + public void setSeverity(DueDateSeverity severity) { + if (!severity.isValid()) { + this.unparsed = true; + } + this.severity = severity; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDatePerSeverityItem + */ + @JsonAnySetter + public DueDatePerSeverityItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDatePerSeverityItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDatePerSeverityItem dueDatePerSeverityItem = (DueDatePerSeverityItem) o; + return Objects.equals(this.dueInDays, dueDatePerSeverityItem.dueInDays) + && Objects.equals(this.severity, dueDatePerSeverityItem.severity) + && Objects.equals(this.additionalProperties, dueDatePerSeverityItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dueInDays, severity, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDatePerSeverityItem {\n"); + sb.append(" dueInDays: ").append(toIndentedString(dueInDays)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).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/DueDateRuleAction.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleAction.java new file mode 100644 index 00000000000..62b06b4dfe6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleAction.java @@ -0,0 +1,219 @@ +/* + * 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 action to take when the due date rule matches a finding. */ +@JsonPropertyOrder({ + DueDateRuleAction.JSON_PROPERTY_DUE_DAYS_PER_SEVERITY, + DueDateRuleAction.JSON_PROPERTY_DUE_FROM, + DueDateRuleAction.JSON_PROPERTY_REASON_DESCRIPTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleAction { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DUE_DAYS_PER_SEVERITY = "due_days_per_severity"; + private List dueDaysPerSeverity = new ArrayList<>(); + + public static final String JSON_PROPERTY_DUE_FROM = "due_from"; + private DueDateFrom dueFrom; + + public static final String JSON_PROPERTY_REASON_DESCRIPTION = "reason_description"; + private String reasonDescription; + + public DueDateRuleAction() {} + + @JsonCreator + public DueDateRuleAction( + @JsonProperty(required = true, value = JSON_PROPERTY_DUE_DAYS_PER_SEVERITY) + List dueDaysPerSeverity, + @JsonProperty(required = true, value = JSON_PROPERTY_DUE_FROM) DueDateFrom dueFrom) { + this.dueDaysPerSeverity = dueDaysPerSeverity; + this.dueFrom = dueFrom; + this.unparsed |= !dueFrom.isValid(); + } + + public DueDateRuleAction dueDaysPerSeverity(List dueDaysPerSeverity) { + this.dueDaysPerSeverity = dueDaysPerSeverity; + for (DueDatePerSeverityItem item : dueDaysPerSeverity) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DueDateRuleAction addDueDaysPerSeverityItem( + DueDatePerSeverityItem dueDaysPerSeverityItem) { + this.dueDaysPerSeverity.add(dueDaysPerSeverityItem); + this.unparsed |= dueDaysPerSeverityItem.unparsed; + return this; + } + + /** + * A list of severity-to-due-date mappings. Each severity may appear at most once. + * + * @return dueDaysPerSeverity + */ + @JsonProperty(JSON_PROPERTY_DUE_DAYS_PER_SEVERITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getDueDaysPerSeverity() { + return dueDaysPerSeverity; + } + + public void setDueDaysPerSeverity(List dueDaysPerSeverity) { + this.dueDaysPerSeverity = dueDaysPerSeverity; + } + + public DueDateRuleAction dueFrom(DueDateFrom dueFrom) { + this.dueFrom = dueFrom; + this.unparsed |= !dueFrom.isValid(); + return this; + } + + /** + * The reference point from which the due date is calculated. When fix_available is + * selected but not applicable to the finding type, first_seen is used instead. + * + * @return dueFrom + */ + @JsonProperty(JSON_PROPERTY_DUE_FROM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateFrom getDueFrom() { + return dueFrom; + } + + public void setDueFrom(DueDateFrom dueFrom) { + if (!dueFrom.isValid()) { + this.unparsed = true; + } + this.dueFrom = dueFrom; + } + + public DueDateRuleAction reasonDescription(String reasonDescription) { + this.reasonDescription = reasonDescription; + return this; + } + + /** + * An optional description providing more context for the due date assignment. + * + * @return reasonDescription + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASON_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReasonDescription() { + return reasonDescription; + } + + public void setReasonDescription(String reasonDescription) { + this.reasonDescription = reasonDescription; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleAction + */ + @JsonAnySetter + public DueDateRuleAction putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleAction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleAction dueDateRuleAction = (DueDateRuleAction) o; + return Objects.equals(this.dueDaysPerSeverity, dueDateRuleAction.dueDaysPerSeverity) + && Objects.equals(this.dueFrom, dueDateRuleAction.dueFrom) + && Objects.equals(this.reasonDescription, dueDateRuleAction.reasonDescription) + && Objects.equals(this.additionalProperties, dueDateRuleAction.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dueDaysPerSeverity, dueFrom, reasonDescription, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRuleAction {\n"); + sb.append(" dueDaysPerSeverity: ").append(toIndentedString(dueDaysPerSeverity)).append("\n"); + sb.append(" dueFrom: ").append(toIndentedString(dueFrom)).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/DueDateRuleAttributesCreate.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleAttributesCreate.java new file mode 100644 index 00000000000..12c3f7b3479 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleAttributesCreate.java @@ -0,0 +1,233 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for creating or updating a due date rule. */ +@JsonPropertyOrder({ + DueDateRuleAttributesCreate.JSON_PROPERTY_ACTION, + DueDateRuleAttributesCreate.JSON_PROPERTY_ENABLED, + DueDateRuleAttributesCreate.JSON_PROPERTY_NAME, + DueDateRuleAttributesCreate.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleAttributesCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private DueDateRuleAction 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 AutomationRuleScope rule; + + public DueDateRuleAttributesCreate() {} + + @JsonCreator + public DueDateRuleAttributesCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) DueDateRuleAction action, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) AutomationRuleScope rule) { + this.action = action; + this.unparsed |= action.unparsed; + this.name = name; + this.rule = rule; + this.unparsed |= rule.unparsed; + } + + public DueDateRuleAttributesCreate action(DueDateRuleAction action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * The action to take when the due date rule matches a finding. + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleAction getAction() { + return action; + } + + public void setAction(DueDateRuleAction action) { + this.action = action; + } + + public DueDateRuleAttributesCreate enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the due date rule is enabled. + * + * @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 DueDateRuleAttributesCreate name(String name) { + this.name = name; + return this; + } + + /** + * The name of the due date 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 DueDateRuleAttributesCreate rule(AutomationRuleScope rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * Defines the scope of findings to which the automation rule applies. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleScope getRule() { + return rule; + } + + public void setRule(AutomationRuleScope rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleAttributesCreate + */ + @JsonAnySetter + public DueDateRuleAttributesCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleAttributesCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleAttributesCreate dueDateRuleAttributesCreate = (DueDateRuleAttributesCreate) o; + return Objects.equals(this.action, dueDateRuleAttributesCreate.action) + && Objects.equals(this.enabled, dueDateRuleAttributesCreate.enabled) + && Objects.equals(this.name, dueDateRuleAttributesCreate.name) + && Objects.equals(this.rule, dueDateRuleAttributesCreate.rule) + && Objects.equals( + this.additionalProperties, dueDateRuleAttributesCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, enabled, name, rule, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRuleAttributesCreate {\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/DueDateRuleAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleAttributesResponse.java new file mode 100644 index 00000000000..0859967075f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleAttributesResponse.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 a due date rule returned by the API. */ +@JsonPropertyOrder({ + DueDateRuleAttributesResponse.JSON_PROPERTY_ACTION, + DueDateRuleAttributesResponse.JSON_PROPERTY_CREATED_AT, + DueDateRuleAttributesResponse.JSON_PROPERTY_CREATED_BY, + DueDateRuleAttributesResponse.JSON_PROPERTY_ENABLED, + DueDateRuleAttributesResponse.JSON_PROPERTY_MODIFIED_AT, + DueDateRuleAttributesResponse.JSON_PROPERTY_MODIFIED_BY, + DueDateRuleAttributesResponse.JSON_PROPERTY_NAME, + DueDateRuleAttributesResponse.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private DueDateRuleAction 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 AutomationRuleCreatedBy 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 AutomationRuleModifiedBy modifiedBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private AutomationRuleScope rule; + + public DueDateRuleAttributesResponse() {} + + @JsonCreator + public DueDateRuleAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) DueDateRuleAction action, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) Long createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) + AutomationRuleCreatedBy 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) + AutomationRuleModifiedBy modifiedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) AutomationRuleScope 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 DueDateRuleAttributesResponse action(DueDateRuleAction action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * The action to take when the due date rule matches a finding. + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleAction getAction() { + return action; + } + + public void setAction(DueDateRuleAction action) { + this.action = action; + } + + public DueDateRuleAttributesResponse createdAt(Long createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The Unix timestamp in milliseconds when the rule was created. + * + * @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 DueDateRuleAttributesResponse createdBy(AutomationRuleCreatedBy createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * The user or Datadog system who created the rule. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleCreatedBy getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(AutomationRuleCreatedBy createdBy) { + this.createdBy = createdBy; + } + + public DueDateRuleAttributesResponse enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the due date rule is enabled. + * + * @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 DueDateRuleAttributesResponse modifiedAt(Long modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The Unix timestamp in milliseconds when the rule was last modified. + * + * @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 DueDateRuleAttributesResponse modifiedBy(AutomationRuleModifiedBy modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * The user or Datadog system who last modified the rule. + * + * @return modifiedBy + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleModifiedBy getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(AutomationRuleModifiedBy modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public DueDateRuleAttributesResponse name(String name) { + this.name = name; + return this; + } + + /** + * The name of the due date 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 DueDateRuleAttributesResponse rule(AutomationRuleScope rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * Defines the scope of findings to which the automation rule applies. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleScope getRule() { + return rule; + } + + public void setRule(AutomationRuleScope rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleAttributesResponse + */ + @JsonAnySetter + public DueDateRuleAttributesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleAttributesResponse dueDateRuleAttributesResponse = (DueDateRuleAttributesResponse) o; + return Objects.equals(this.action, dueDateRuleAttributesResponse.action) + && Objects.equals(this.createdAt, dueDateRuleAttributesResponse.createdAt) + && Objects.equals(this.createdBy, dueDateRuleAttributesResponse.createdBy) + && Objects.equals(this.enabled, dueDateRuleAttributesResponse.enabled) + && Objects.equals(this.modifiedAt, dueDateRuleAttributesResponse.modifiedAt) + && Objects.equals(this.modifiedBy, dueDateRuleAttributesResponse.modifiedBy) + && Objects.equals(this.name, dueDateRuleAttributesResponse.name) + && Objects.equals(this.rule, dueDateRuleAttributesResponse.rule) + && Objects.equals( + this.additionalProperties, dueDateRuleAttributesResponse.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 DueDateRuleAttributesResponse {\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/DueDateRuleCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleCreateRequest.java new file mode 100644 index 00000000000..9ecf64d2ada --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleCreateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The body of a due date rule create request. */ +@JsonPropertyOrder({DueDateRuleCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DueDateRuleDataCreate data; + + public DueDateRuleCreateRequest() {} + + @JsonCreator + public DueDateRuleCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) DueDateRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DueDateRuleCreateRequest data(DueDateRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a due date rule create or update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleDataCreate getData() { + return data; + } + + public void setData(DueDateRuleDataCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleCreateRequest + */ + @JsonAnySetter + public DueDateRuleCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleCreateRequest dueDateRuleCreateRequest = (DueDateRuleCreateRequest) o; + return Objects.equals(this.data, dueDateRuleCreateRequest.data) + && Objects.equals(this.additionalProperties, dueDateRuleCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRuleCreateRequest {\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/DueDateRuleDataCreate.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleDataCreate.java new file mode 100644 index 00000000000..1d7df0d8afb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleDataCreate.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; + +/** The data object for a due date rule create or update request. */ +@JsonPropertyOrder({ + DueDateRuleDataCreate.JSON_PROPERTY_ATTRIBUTES, + DueDateRuleDataCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleDataCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DueDateRuleAttributesCreate attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DueDateRuleType type; + + public DueDateRuleDataCreate() {} + + @JsonCreator + public DueDateRuleDataCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DueDateRuleAttributesCreate attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DueDateRuleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DueDateRuleDataCreate attributes(DueDateRuleAttributesCreate attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating or updating a due date rule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleAttributesCreate getAttributes() { + return attributes; + } + + public void setAttributes(DueDateRuleAttributesCreate attributes) { + this.attributes = attributes; + } + + public DueDateRuleDataCreate type(DueDateRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for due date rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleType getType() { + return type; + } + + public void setType(DueDateRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleDataCreate + */ + @JsonAnySetter + public DueDateRuleDataCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleDataCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleDataCreate dueDateRuleDataCreate = (DueDateRuleDataCreate) o; + return Objects.equals(this.attributes, dueDateRuleDataCreate.attributes) + && Objects.equals(this.type, dueDateRuleDataCreate.type) + && Objects.equals(this.additionalProperties, dueDateRuleDataCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRuleDataCreate {\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/DueDateRuleDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleDataResponse.java new file mode 100644 index 00000000000..624d1a8e809 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleDataResponse.java @@ -0,0 +1,210 @@ +/* + * 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; + +/** The data object for a due date rule returned by the API. */ +@JsonPropertyOrder({ + DueDateRuleDataResponse.JSON_PROPERTY_ATTRIBUTES, + DueDateRuleDataResponse.JSON_PROPERTY_ID, + DueDateRuleDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DueDateRuleAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DueDateRuleType type; + + public DueDateRuleDataResponse() {} + + @JsonCreator + public DueDateRuleDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DueDateRuleAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DueDateRuleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DueDateRuleDataResponse attributes(DueDateRuleAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a due date rule returned by the API. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(DueDateRuleAttributesResponse attributes) { + this.attributes = attributes; + } + + public DueDateRuleDataResponse id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the due date 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 DueDateRuleDataResponse type(DueDateRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for due date rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleType getType() { + return type; + } + + public void setType(DueDateRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleDataResponse + */ + @JsonAnySetter + public DueDateRuleDataResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleDataResponse dueDateRuleDataResponse = (DueDateRuleDataResponse) o; + return Objects.equals(this.attributes, dueDateRuleDataResponse.attributes) + && Objects.equals(this.id, dueDateRuleDataResponse.id) + && Objects.equals(this.type, dueDateRuleDataResponse.type) + && Objects.equals(this.additionalProperties, dueDateRuleDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRuleDataResponse {\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/DueDateRuleReorderItem.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleReorderItem.java new file mode 100644 index 00000000000..5dd56d8440c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleReorderItem.java @@ -0,0 +1,179 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** A reference to a due date rule used for reordering. */ +@JsonPropertyOrder({ + DueDateRuleReorderItem.JSON_PROPERTY_ID, + DueDateRuleReorderItem.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleReorderItem { + @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 DueDateRuleType type; + + public DueDateRuleReorderItem() {} + + @JsonCreator + public DueDateRuleReorderItem( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) DueDateRuleType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public DueDateRuleReorderItem id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the automation 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 DueDateRuleReorderItem type(DueDateRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for due date rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleType getType() { + return type; + } + + public void setType(DueDateRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleReorderItem + */ + @JsonAnySetter + public DueDateRuleReorderItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleReorderItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleReorderItem dueDateRuleReorderItem = (DueDateRuleReorderItem) o; + return Objects.equals(this.id, dueDateRuleReorderItem.id) + && Objects.equals(this.type, dueDateRuleReorderItem.type) + && Objects.equals(this.additionalProperties, dueDateRuleReorderItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRuleReorderItem {\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/DueDateRuleReorderRequest.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleReorderRequest.java new file mode 100644 index 00000000000..0a45dabca83 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleReorderRequest.java @@ -0,0 +1,156 @@ +/* + * 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 body of the due date rule reorder request. */ +@JsonPropertyOrder({DueDateRuleReorderRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleReorderRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public DueDateRuleReorderRequest() {} + + @JsonCreator + public DueDateRuleReorderRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public DueDateRuleReorderRequest data(List data) { + this.data = data; + for (DueDateRuleReorderItem item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DueDateRuleReorderRequest addDataItem(DueDateRuleReorderItem dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The ordered list of all due date rules; every rule must be included. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleReorderRequest + */ + @JsonAnySetter + public DueDateRuleReorderRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleReorderRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleReorderRequest dueDateRuleReorderRequest = (DueDateRuleReorderRequest) o; + return Objects.equals(this.data, dueDateRuleReorderRequest.data) + && Objects.equals( + this.additionalProperties, dueDateRuleReorderRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRuleReorderRequest {\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/DueDateRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleResponse.java new file mode 100644 index 00000000000..d48b6fc09f5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleResponse.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A single due date rule response. */ +@JsonPropertyOrder({DueDateRuleResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DueDateRuleDataResponse data; + + public DueDateRuleResponse() {} + + @JsonCreator + public DueDateRuleResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) DueDateRuleDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DueDateRuleResponse data(DueDateRuleDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a due date rule returned by the API. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleDataResponse getData() { + return data; + } + + public void setData(DueDateRuleDataResponse data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleResponse + */ + @JsonAnySetter + public DueDateRuleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleResponse dueDateRuleResponse = (DueDateRuleResponse) o; + return Objects.equals(this.data, dueDateRuleResponse.data) + && Objects.equals(this.additionalProperties, dueDateRuleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRuleResponse {\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/DueDateRuleType.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleType.java new file mode 100644 index 00000000000..1f9756f0bd5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleType.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 JSON:API type for due date rules. */ +@JsonSerialize(using = DueDateRuleType.DueDateRuleTypeSerializer.class) +public class DueDateRuleType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("due_date_rules")); + + public static final DueDateRuleType DUE_DATE_RULES = new DueDateRuleType("due_date_rules"); + + DueDateRuleType(String value) { + super(value, allowedValues); + } + + public static class DueDateRuleTypeSerializer extends StdSerializer { + public DueDateRuleTypeSerializer(Class t) { + super(t); + } + + public DueDateRuleTypeSerializer() { + this(null); + } + + @Override + public void serialize(DueDateRuleType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DueDateRuleType fromValue(String value) { + return new DueDateRuleType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DueDateRuleUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleUpdateRequest.java new file mode 100644 index 00000000000..4c0ee50fa0f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRuleUpdateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The body of a due date rule update request. */ +@JsonPropertyOrder({DueDateRuleUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRuleUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DueDateRuleDataCreate data; + + public DueDateRuleUpdateRequest() {} + + @JsonCreator + public DueDateRuleUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) DueDateRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DueDateRuleUpdateRequest data(DueDateRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a due date rule create or update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DueDateRuleDataCreate getData() { + return data; + } + + public void setData(DueDateRuleDataCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRuleUpdateRequest + */ + @JsonAnySetter + public DueDateRuleUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRuleUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRuleUpdateRequest dueDateRuleUpdateRequest = (DueDateRuleUpdateRequest) o; + return Objects.equals(this.data, dueDateRuleUpdateRequest.data) + && Objects.equals(this.additionalProperties, dueDateRuleUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRuleUpdateRequest {\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/DueDateRulesResponse.java b/src/main/java/com/datadog/api/client/v2/model/DueDateRulesResponse.java new file mode 100644 index 00000000000..91b0c5b9155 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateRulesResponse.java @@ -0,0 +1,217 @@ +/* + * 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; + +/** A list of due date rules with pagination metadata. */ +@JsonPropertyOrder({ + DueDateRulesResponse.JSON_PROPERTY_DATA, + DueDateRulesResponse.JSON_PROPERTY_LINKS, + DueDateRulesResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DueDateRulesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_LINKS = "links"; + private SecurityAutomationRulesLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private SecurityAutomationRulesMeta meta; + + public DueDateRulesResponse() {} + + @JsonCreator + public DueDateRulesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data, + @JsonProperty(required = true, value = JSON_PROPERTY_LINKS) + SecurityAutomationRulesLinks links, + @JsonProperty(required = true, value = JSON_PROPERTY_META) SecurityAutomationRulesMeta meta) { + this.data = data; + this.links = links; + this.unparsed |= links.unparsed; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public DueDateRulesResponse data(List data) { + this.data = data; + for (DueDateRuleDataResponse item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DueDateRulesResponse addDataItem(DueDateRuleDataResponse dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of due date rule data objects. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public DueDateRulesResponse links(SecurityAutomationRulesLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Pagination links for the list of automation rules. + * + * @return links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SecurityAutomationRulesLinks getLinks() { + return links; + } + + public void setLinks(SecurityAutomationRulesLinks links) { + this.links = links; + } + + public DueDateRulesResponse meta(SecurityAutomationRulesMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for the list of automation rules. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SecurityAutomationRulesMeta getMeta() { + return meta; + } + + public void setMeta(SecurityAutomationRulesMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DueDateRulesResponse + */ + @JsonAnySetter + public DueDateRulesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this DueDateRulesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DueDateRulesResponse dueDateRulesResponse = (DueDateRulesResponse) o; + return Objects.equals(this.data, dueDateRulesResponse.data) + && Objects.equals(this.links, dueDateRulesResponse.links) + && Objects.equals(this.meta, dueDateRulesResponse.meta) + && Objects.equals(this.additionalProperties, dueDateRulesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DueDateRulesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/DueDateSeverity.java b/src/main/java/com/datadog/api/client/v2/model/DueDateSeverity.java new file mode 100644 index 00000000000..82fc723a4e5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DueDateSeverity.java @@ -0,0 +1,61 @@ +/* + * 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; + +/** A severity level used to configure due date thresholds. */ +@JsonSerialize(using = DueDateSeverity.DueDateSeveritySerializer.class) +public class DueDateSeverity extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("critical", "high", "medium", "low", "info", "none", "unknown")); + + public static final DueDateSeverity CRITICAL = new DueDateSeverity("critical"); + public static final DueDateSeverity HIGH = new DueDateSeverity("high"); + public static final DueDateSeverity MEDIUM = new DueDateSeverity("medium"); + public static final DueDateSeverity LOW = new DueDateSeverity("low"); + public static final DueDateSeverity INFO = new DueDateSeverity("info"); + public static final DueDateSeverity NONE = new DueDateSeverity("none"); + public static final DueDateSeverity UNKNOWN = new DueDateSeverity("unknown"); + + DueDateSeverity(String value) { + super(value, allowedValues); + } + + public static class DueDateSeveritySerializer extends StdSerializer { + public DueDateSeveritySerializer(Class t) { + super(t); + } + + public DueDateSeveritySerializer() { + this(null); + } + + @Override + public void serialize(DueDateSeverity value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DueDateSeverity fromValue(String value) { + return new DueDateSeverity(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..52ae10d9f7b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteReason.java @@ -0,0 +1,61 @@ +/* + * 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 reason for muting a security finding. */ +@JsonSerialize(using = MuteReason.MuteReasonSerializer.class) +public class MuteReason extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "duplicate", "false_positive", "no_fix", "other", "pending_fix", "risk_accepted")); + + public static final MuteReason DUPLICATE = new MuteReason("duplicate"); + public static final MuteReason FALSE_POSITIVE = new MuteReason("false_positive"); + public static final MuteReason NO_FIX = new MuteReason("no_fix"); + public static final MuteReason OTHER = new MuteReason("other"); + public static final MuteReason PENDING_FIX = new MuteReason("pending_fix"); + public static final MuteReason RISK_ACCEPTED = new MuteReason("risk_accepted"); + + MuteReason(String value) { + super(value, allowedValues); + } + + public static class MuteReasonSerializer extends StdSerializer { + public MuteReasonSerializer(Class t) { + super(t); + } + + public MuteReasonSerializer() { + this(null); + } + + @Override + public void serialize(MuteReason value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static MuteReason fromValue(String value) { + return new MuteReason(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteRuleAction.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleAction.java new file mode 100644 index 00000000000..0e3935394e3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleAction.java @@ -0,0 +1,205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The action to take when the mute rule matches a finding. */ +@JsonPropertyOrder({ + MuteRuleAction.JSON_PROPERTY_EXPIRE_AT, + MuteRuleAction.JSON_PROPERTY_REASON, + MuteRuleAction.JSON_PROPERTY_REASON_DESCRIPTION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleAction { + @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 MuteRuleAction() {} + + @JsonCreator + public MuteRuleAction( + @JsonProperty(required = true, value = JSON_PROPERTY_REASON) MuteReason reason) { + this.reason = reason; + this.unparsed |= !reason.isValid(); + } + + public MuteRuleAction expireAt(Long expireAt) { + this.expireAt = expireAt; + return this; + } + + /** + * The Unix timestamp in milliseconds at which the mute expires. If omitted, the mute does not + * expire. + * + * @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 MuteRuleAction reason(MuteReason reason) { + this.reason = reason; + this.unparsed |= !reason.isValid(); + return this; + } + + /** + * The reason for muting a security finding. + * + * @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 MuteRuleAction reasonDescription(String reasonDescription) { + this.reasonDescription = reasonDescription; + return this; + } + + /** + * An optional description providing more context for the mute reason. + * + * @return reasonDescription + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REASON_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getReasonDescription() { + return reasonDescription; + } + + public void setReasonDescription(String reasonDescription) { + this.reasonDescription = reasonDescription; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleAction + */ + @JsonAnySetter + public MuteRuleAction putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleAction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleAction muteRuleAction = (MuteRuleAction) o; + return Objects.equals(this.expireAt, muteRuleAction.expireAt) + && Objects.equals(this.reason, muteRuleAction.reason) + && Objects.equals(this.reasonDescription, muteRuleAction.reasonDescription) + && Objects.equals(this.additionalProperties, muteRuleAction.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(expireAt, reason, reasonDescription, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleAction {\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/MuteRuleAttributesCreate.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleAttributesCreate.java new file mode 100644 index 00000000000..34dcec4fc95 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleAttributesCreate.java @@ -0,0 +1,232 @@ +/* + * 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 for creating or updating a mute rule. */ +@JsonPropertyOrder({ + MuteRuleAttributesCreate.JSON_PROPERTY_ACTION, + MuteRuleAttributesCreate.JSON_PROPERTY_ENABLED, + MuteRuleAttributesCreate.JSON_PROPERTY_NAME, + MuteRuleAttributesCreate.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleAttributesCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private MuteRuleAction 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 AutomationRuleScope rule; + + public MuteRuleAttributesCreate() {} + + @JsonCreator + public MuteRuleAttributesCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) MuteRuleAction action, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) AutomationRuleScope rule) { + this.action = action; + this.unparsed |= action.unparsed; + this.name = name; + this.rule = rule; + this.unparsed |= rule.unparsed; + } + + public MuteRuleAttributesCreate action(MuteRuleAction action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * The action to take when the mute rule matches a finding. + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleAction getAction() { + return action; + } + + public void setAction(MuteRuleAction action) { + this.action = action; + } + + public MuteRuleAttributesCreate enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the mute rule is enabled. + * + * @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 MuteRuleAttributesCreate name(String name) { + this.name = name; + return this; + } + + /** + * The name of the mute 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 MuteRuleAttributesCreate rule(AutomationRuleScope rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * Defines the scope of findings to which the automation rule applies. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleScope getRule() { + return rule; + } + + public void setRule(AutomationRuleScope rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleAttributesCreate + */ + @JsonAnySetter + public MuteRuleAttributesCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleAttributesCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleAttributesCreate muteRuleAttributesCreate = (MuteRuleAttributesCreate) o; + return Objects.equals(this.action, muteRuleAttributesCreate.action) + && Objects.equals(this.enabled, muteRuleAttributesCreate.enabled) + && Objects.equals(this.name, muteRuleAttributesCreate.name) + && Objects.equals(this.rule, muteRuleAttributesCreate.rule) + && Objects.equals(this.additionalProperties, muteRuleAttributesCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, enabled, name, rule, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleAttributesCreate {\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/MuteRuleAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleAttributesResponse.java new file mode 100644 index 00000000000..c9505a6a239 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleAttributesResponse.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 a mute rule returned by the API. */ +@JsonPropertyOrder({ + MuteRuleAttributesResponse.JSON_PROPERTY_ACTION, + MuteRuleAttributesResponse.JSON_PROPERTY_CREATED_AT, + MuteRuleAttributesResponse.JSON_PROPERTY_CREATED_BY, + MuteRuleAttributesResponse.JSON_PROPERTY_ENABLED, + MuteRuleAttributesResponse.JSON_PROPERTY_MODIFIED_AT, + MuteRuleAttributesResponse.JSON_PROPERTY_MODIFIED_BY, + MuteRuleAttributesResponse.JSON_PROPERTY_NAME, + MuteRuleAttributesResponse.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private MuteRuleAction 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 AutomationRuleCreatedBy 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 AutomationRuleModifiedBy modifiedBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private AutomationRuleScope rule; + + public MuteRuleAttributesResponse() {} + + @JsonCreator + public MuteRuleAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) MuteRuleAction action, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) Long createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) + AutomationRuleCreatedBy 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) + AutomationRuleModifiedBy modifiedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) AutomationRuleScope 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 MuteRuleAttributesResponse action(MuteRuleAction action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * The action to take when the mute rule matches a finding. + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleAction getAction() { + return action; + } + + public void setAction(MuteRuleAction action) { + this.action = action; + } + + public MuteRuleAttributesResponse createdAt(Long createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The Unix timestamp in milliseconds when the rule was created. + * + * @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 MuteRuleAttributesResponse createdBy(AutomationRuleCreatedBy createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * The user or Datadog system who created the rule. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleCreatedBy getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(AutomationRuleCreatedBy createdBy) { + this.createdBy = createdBy; + } + + public MuteRuleAttributesResponse enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the mute rule is enabled. + * + * @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 MuteRuleAttributesResponse modifiedAt(Long modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The Unix timestamp in milliseconds when the rule was last modified. + * + * @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 MuteRuleAttributesResponse modifiedBy(AutomationRuleModifiedBy modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * The user or Datadog system who last modified the rule. + * + * @return modifiedBy + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleModifiedBy getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(AutomationRuleModifiedBy modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public MuteRuleAttributesResponse name(String name) { + this.name = name; + return this; + } + + /** + * The name of the mute 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 MuteRuleAttributesResponse rule(AutomationRuleScope rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * Defines the scope of findings to which the automation rule applies. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleScope getRule() { + return rule; + } + + public void setRule(AutomationRuleScope rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleAttributesResponse + */ + @JsonAnySetter + public MuteRuleAttributesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleAttributesResponse muteRuleAttributesResponse = (MuteRuleAttributesResponse) o; + return Objects.equals(this.action, muteRuleAttributesResponse.action) + && Objects.equals(this.createdAt, muteRuleAttributesResponse.createdAt) + && Objects.equals(this.createdBy, muteRuleAttributesResponse.createdBy) + && Objects.equals(this.enabled, muteRuleAttributesResponse.enabled) + && Objects.equals(this.modifiedAt, muteRuleAttributesResponse.modifiedAt) + && Objects.equals(this.modifiedBy, muteRuleAttributesResponse.modifiedBy) + && Objects.equals(this.name, muteRuleAttributesResponse.name) + && Objects.equals(this.rule, muteRuleAttributesResponse.rule) + && Objects.equals( + this.additionalProperties, muteRuleAttributesResponse.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 MuteRuleAttributesResponse {\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/MuteRuleCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleCreateRequest.java new file mode 100644 index 00000000000..33c3d75e331 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleCreateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The body of a mute rule create request. */ +@JsonPropertyOrder({MuteRuleCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MuteRuleDataCreate data; + + public MuteRuleCreateRequest() {} + + @JsonCreator + public MuteRuleCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) MuteRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MuteRuleCreateRequest data(MuteRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a mute rule create or update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleDataCreate getData() { + return data; + } + + public void setData(MuteRuleDataCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleCreateRequest + */ + @JsonAnySetter + public MuteRuleCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleCreateRequest muteRuleCreateRequest = (MuteRuleCreateRequest) o; + return Objects.equals(this.data, muteRuleCreateRequest.data) + && Objects.equals(this.additionalProperties, muteRuleCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleCreateRequest {\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/MuteRuleDataCreate.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleDataCreate.java new file mode 100644 index 00000000000..1aff6f8c0b6 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleDataCreate.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; + +/** The data object for a mute rule create or update request. */ +@JsonPropertyOrder({ + MuteRuleDataCreate.JSON_PROPERTY_ATTRIBUTES, + MuteRuleDataCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleDataCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MuteRuleAttributesCreate attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MuteRuleType type; + + public MuteRuleDataCreate() {} + + @JsonCreator + public MuteRuleDataCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + MuteRuleAttributesCreate attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MuteRuleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MuteRuleDataCreate attributes(MuteRuleAttributesCreate attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating or updating a mute rule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleAttributesCreate getAttributes() { + return attributes; + } + + public void setAttributes(MuteRuleAttributesCreate attributes) { + this.attributes = attributes; + } + + public MuteRuleDataCreate type(MuteRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for mute rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleType getType() { + return type; + } + + public void setType(MuteRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleDataCreate + */ + @JsonAnySetter + public MuteRuleDataCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleDataCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleDataCreate muteRuleDataCreate = (MuteRuleDataCreate) o; + return Objects.equals(this.attributes, muteRuleDataCreate.attributes) + && Objects.equals(this.type, muteRuleDataCreate.type) + && Objects.equals(this.additionalProperties, muteRuleDataCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleDataCreate {\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/MuteRuleDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleDataResponse.java new file mode 100644 index 00000000000..1f5a6e36f42 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleDataResponse.java @@ -0,0 +1,210 @@ +/* + * 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; + +/** The data object for a mute rule returned by the API. */ +@JsonPropertyOrder({ + MuteRuleDataResponse.JSON_PROPERTY_ATTRIBUTES, + MuteRuleDataResponse.JSON_PROPERTY_ID, + MuteRuleDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private MuteRuleAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private MuteRuleType type; + + public MuteRuleDataResponse() {} + + @JsonCreator + public MuteRuleDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + MuteRuleAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MuteRuleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MuteRuleDataResponse attributes(MuteRuleAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a mute rule returned by the API. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(MuteRuleAttributesResponse attributes) { + this.attributes = attributes; + } + + public MuteRuleDataResponse id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the mute 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 MuteRuleDataResponse type(MuteRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for mute rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleType getType() { + return type; + } + + public void setType(MuteRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleDataResponse + */ + @JsonAnySetter + public MuteRuleDataResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleDataResponse muteRuleDataResponse = (MuteRuleDataResponse) o; + return Objects.equals(this.attributes, muteRuleDataResponse.attributes) + && Objects.equals(this.id, muteRuleDataResponse.id) + && Objects.equals(this.type, muteRuleDataResponse.type) + && Objects.equals(this.additionalProperties, muteRuleDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleDataResponse {\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/MuteRuleReorderItem.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleReorderItem.java new file mode 100644 index 00000000000..2ecd8767e0f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleReorderItem.java @@ -0,0 +1,176 @@ +/* + * 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; + +/** A reference to a mute rule used for reordering. */ +@JsonPropertyOrder({MuteRuleReorderItem.JSON_PROPERTY_ID, MuteRuleReorderItem.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleReorderItem { + @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 MuteRuleType type; + + public MuteRuleReorderItem() {} + + @JsonCreator + public MuteRuleReorderItem( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) MuteRuleType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public MuteRuleReorderItem id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the automation 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 MuteRuleReorderItem type(MuteRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for mute rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleType getType() { + return type; + } + + public void setType(MuteRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleReorderItem + */ + @JsonAnySetter + public MuteRuleReorderItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleReorderItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleReorderItem muteRuleReorderItem = (MuteRuleReorderItem) o; + return Objects.equals(this.id, muteRuleReorderItem.id) + && Objects.equals(this.type, muteRuleReorderItem.type) + && Objects.equals(this.additionalProperties, muteRuleReorderItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleReorderItem {\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/MuteRuleReorderRequest.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleReorderRequest.java new file mode 100644 index 00000000000..98617bad938 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleReorderRequest.java @@ -0,0 +1,154 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** The body of the mute rule reorder request. */ +@JsonPropertyOrder({MuteRuleReorderRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleReorderRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public MuteRuleReorderRequest() {} + + @JsonCreator + public MuteRuleReorderRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public MuteRuleReorderRequest data(List data) { + this.data = data; + for (MuteRuleReorderItem item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public MuteRuleReorderRequest addDataItem(MuteRuleReorderItem dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The ordered list of all mute rules; every rule must be included. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleReorderRequest + */ + @JsonAnySetter + public MuteRuleReorderRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleReorderRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleReorderRequest muteRuleReorderRequest = (MuteRuleReorderRequest) o; + return Objects.equals(this.data, muteRuleReorderRequest.data) + && Objects.equals(this.additionalProperties, muteRuleReorderRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleReorderRequest {\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/MuteRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleResponse.java new file mode 100644 index 00000000000..2228c87a36a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleResponse.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A single mute rule response. */ +@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 MuteRuleDataResponse data; + + public MuteRuleResponse() {} + + @JsonCreator + public MuteRuleResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) MuteRuleDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MuteRuleResponse data(MuteRuleDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a mute rule returned by the API. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleDataResponse getData() { + return data; + } + + public void setData(MuteRuleDataResponse data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleResponse + */ + @JsonAnySetter + public MuteRuleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleResponse muteRuleResponse = (MuteRuleResponse) o; + return Objects.equals(this.data, muteRuleResponse.data) + && Objects.equals(this.additionalProperties, muteRuleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteRuleType.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleType.java new file mode 100644 index 00000000000..12d7cc9774c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleType.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 JSON:API type for mute rules. */ +@JsonSerialize(using = MuteRuleType.MuteRuleTypeSerializer.class) +public class MuteRuleType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("mute_rules")); + + public static final MuteRuleType MUTE_RULES = new MuteRuleType("mute_rules"); + + MuteRuleType(String value) { + super(value, allowedValues); + } + + public static class MuteRuleTypeSerializer extends StdSerializer { + public MuteRuleTypeSerializer(Class t) { + super(t); + } + + public MuteRuleTypeSerializer() { + this(null); + } + + @Override + public void serialize(MuteRuleType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static MuteRuleType fromValue(String value) { + return new MuteRuleType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MuteRuleUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/MuteRuleUpdateRequest.java new file mode 100644 index 00000000000..08bc91f6f74 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRuleUpdateRequest.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The body of a mute rule update request. */ +@JsonPropertyOrder({MuteRuleUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRuleUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private MuteRuleDataCreate data; + + public MuteRuleUpdateRequest() {} + + @JsonCreator + public MuteRuleUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) MuteRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public MuteRuleUpdateRequest data(MuteRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a mute rule create or update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MuteRuleDataCreate getData() { + return data; + } + + public void setData(MuteRuleDataCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRuleUpdateRequest + */ + @JsonAnySetter + public MuteRuleUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRuleUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRuleUpdateRequest muteRuleUpdateRequest = (MuteRuleUpdateRequest) o; + return Objects.equals(this.data, muteRuleUpdateRequest.data) + && Objects.equals(this.additionalProperties, muteRuleUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRuleUpdateRequest {\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/MuteRulesResponse.java b/src/main/java/com/datadog/api/client/v2/model/MuteRulesResponse.java new file mode 100644 index 00000000000..69baa529e94 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MuteRulesResponse.java @@ -0,0 +1,217 @@ +/* + * 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; + +/** A list of mute rules with pagination metadata. */ +@JsonPropertyOrder({ + MuteRulesResponse.JSON_PROPERTY_DATA, + MuteRulesResponse.JSON_PROPERTY_LINKS, + MuteRulesResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MuteRulesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_LINKS = "links"; + private SecurityAutomationRulesLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private SecurityAutomationRulesMeta meta; + + public MuteRulesResponse() {} + + @JsonCreator + public MuteRulesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data, + @JsonProperty(required = true, value = JSON_PROPERTY_LINKS) + SecurityAutomationRulesLinks links, + @JsonProperty(required = true, value = JSON_PROPERTY_META) SecurityAutomationRulesMeta meta) { + this.data = data; + this.links = links; + this.unparsed |= links.unparsed; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public MuteRulesResponse data(List data) { + this.data = data; + for (MuteRuleDataResponse item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public MuteRulesResponse addDataItem(MuteRuleDataResponse dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of mute rule data objects. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public MuteRulesResponse links(SecurityAutomationRulesLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Pagination links for the list of automation rules. + * + * @return links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SecurityAutomationRulesLinks getLinks() { + return links; + } + + public void setLinks(SecurityAutomationRulesLinks links) { + this.links = links; + } + + public MuteRulesResponse meta(SecurityAutomationRulesMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for the list of automation rules. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SecurityAutomationRulesMeta getMeta() { + return meta; + } + + public void setMeta(SecurityAutomationRulesMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MuteRulesResponse + */ + @JsonAnySetter + public MuteRulesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MuteRulesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MuteRulesResponse muteRulesResponse = (MuteRulesResponse) o; + return Objects.equals(this.data, muteRulesResponse.data) + && Objects.equals(this.links, muteRulesResponse.links) + && Objects.equals(this.meta, muteRulesResponse.meta) + && Objects.equals(this.additionalProperties, muteRulesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MuteRulesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/SecurityAutomationRulesLinks.java b/src/main/java/com/datadog/api/client/v2/model/SecurityAutomationRulesLinks.java new file mode 100644 index 00000000000..747f07dd7b4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityAutomationRulesLinks.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.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; + +/** Pagination links for the list of automation rules. */ +@JsonPropertyOrder({ + SecurityAutomationRulesLinks.JSON_PROPERTY_FIRST, + SecurityAutomationRulesLinks.JSON_PROPERTY_LAST, + SecurityAutomationRulesLinks.JSON_PROPERTY_NEXT, + SecurityAutomationRulesLinks.JSON_PROPERTY_PREV +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecurityAutomationRulesLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST = "first"; + private String first; + + public static final String JSON_PROPERTY_LAST = "last"; + private String last; + + public static final String JSON_PROPERTY_NEXT = "next"; + private String next; + + public static final String JSON_PROPERTY_PREV = "prev"; + private String prev; + + public SecurityAutomationRulesLinks() {} + + @JsonCreator + public SecurityAutomationRulesLinks( + @JsonProperty(required = true, value = JSON_PROPERTY_FIRST) String first, + @JsonProperty(required = true, value = JSON_PROPERTY_LAST) String last) { + this.first = first; + this.last = last; + } + + public SecurityAutomationRulesLinks first(String first) { + this.first = first; + return this; + } + + /** + * Link to the first page of results. + * + * @return first + */ + @JsonProperty(JSON_PROPERTY_FIRST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFirst() { + return first; + } + + public void setFirst(String first) { + this.first = first; + } + + public SecurityAutomationRulesLinks last(String last) { + this.last = last; + return this; + } + + /** + * Link to the last page of results. + * + * @return last + */ + @JsonProperty(JSON_PROPERTY_LAST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getLast() { + return last; + } + + public void setLast(String last) { + this.last = last; + } + + public SecurityAutomationRulesLinks next(String next) { + this.next = next; + return this; + } + + /** + * Link to the next page of results. + * + * @return next + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + public SecurityAutomationRulesLinks prev(String prev) { + this.prev = prev; + return this; + } + + /** + * Link to the previous page of results. + * + * @return prev + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrev() { + return prev; + } + + public void setPrev(String prev) { + this.prev = prev; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SecurityAutomationRulesLinks + */ + @JsonAnySetter + public SecurityAutomationRulesLinks putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SecurityAutomationRulesLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityAutomationRulesLinks securityAutomationRulesLinks = (SecurityAutomationRulesLinks) o; + return Objects.equals(this.first, securityAutomationRulesLinks.first) + && Objects.equals(this.last, securityAutomationRulesLinks.last) + && Objects.equals(this.next, securityAutomationRulesLinks.next) + && Objects.equals(this.prev, securityAutomationRulesLinks.prev) + && Objects.equals( + this.additionalProperties, securityAutomationRulesLinks.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(first, last, next, prev, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityAutomationRulesLinks {\n"); + sb.append(" first: ").append(toIndentedString(first)).append("\n"); + sb.append(" last: ").append(toIndentedString(last)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" prev: ").append(toIndentedString(prev)).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/SecurityAutomationRulesMeta.java b/src/main/java/com/datadog/api/client/v2/model/SecurityAutomationRulesMeta.java new file mode 100644 index 00000000000..1b2befa13cb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityAutomationRulesMeta.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata for the list of automation rules. */ +@JsonPropertyOrder({SecurityAutomationRulesMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecurityAutomationRulesMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private SecurityAutomationRulesPageInfo page; + + public SecurityAutomationRulesMeta() {} + + @JsonCreator + public SecurityAutomationRulesMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_PAGE) + SecurityAutomationRulesPageInfo page) { + this.page = page; + this.unparsed |= page.unparsed; + } + + public SecurityAutomationRulesMeta page(SecurityAutomationRulesPageInfo page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination information for the list of automation rules. + * + * @return page + */ + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SecurityAutomationRulesPageInfo getPage() { + return page; + } + + public void setPage(SecurityAutomationRulesPageInfo page) { + this.page = page; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SecurityAutomationRulesMeta + */ + @JsonAnySetter + public SecurityAutomationRulesMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SecurityAutomationRulesMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityAutomationRulesMeta securityAutomationRulesMeta = (SecurityAutomationRulesMeta) o; + return Objects.equals(this.page, securityAutomationRulesMeta.page) + && Objects.equals( + this.additionalProperties, securityAutomationRulesMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityAutomationRulesMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/SecurityAutomationRulesPageInfo.java b/src/main/java/com/datadog/api/client/v2/model/SecurityAutomationRulesPageInfo.java new file mode 100644 index 00000000000..23b454de6c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityAutomationRulesPageInfo.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Pagination information for the list of automation rules. */ +@JsonPropertyOrder({SecurityAutomationRulesPageInfo.JSON_PROPERTY_TOTAL_FILTERED_COUNT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SecurityAutomationRulesPageInfo { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TOTAL_FILTERED_COUNT = "total_filtered_count"; + private Long totalFilteredCount; + + public SecurityAutomationRulesPageInfo() {} + + @JsonCreator + public SecurityAutomationRulesPageInfo( + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_FILTERED_COUNT) + Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + } + + public SecurityAutomationRulesPageInfo totalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + return this; + } + + /** + * The total number of rules matching the current filter. + * + * @return totalFilteredCount + */ + @JsonProperty(JSON_PROPERTY_TOTAL_FILTERED_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalFilteredCount() { + return totalFilteredCount; + } + + public void setTotalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SecurityAutomationRulesPageInfo + */ + @JsonAnySetter + public SecurityAutomationRulesPageInfo putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SecurityAutomationRulesPageInfo object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityAutomationRulesPageInfo securityAutomationRulesPageInfo = + (SecurityAutomationRulesPageInfo) o; + return Objects.equals( + this.totalFilteredCount, securityAutomationRulesPageInfo.totalFilteredCount) + && Objects.equals( + this.additionalProperties, securityAutomationRulesPageInfo.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(totalFilteredCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityAutomationRulesPageInfo {\n"); + sb.append(" totalFilteredCount: ").append(toIndentedString(totalFilteredCount)).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/SecurityFindingType.java b/src/main/java/com/datadog/api/client/v2/model/SecurityFindingType.java new file mode 100644 index 00000000000..b2f46841524 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SecurityFindingType.java @@ -0,0 +1,84 @@ +/* + * 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 security finding that the automation rule applies to. */ +@JsonSerialize(using = SecurityFindingType.SecurityFindingTypeSerializer.class) +public class SecurityFindingType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "api_security", + "attack_path", + "host_and_container_vulnerability", + "iac_misconfiguration", + "identity_risk", + "library_vulnerability", + "misconfiguration", + "runtime_code_vulnerability", + "secret", + "static_code_vulnerability", + "workload_activity")); + + public static final SecurityFindingType API_SECURITY = new SecurityFindingType("api_security"); + public static final SecurityFindingType ATTACK_PATH = new SecurityFindingType("attack_path"); + public static final SecurityFindingType HOST_AND_CONTAINER_VULNERABILITY = + new SecurityFindingType("host_and_container_vulnerability"); + public static final SecurityFindingType IAC_MISCONFIGURATION = + new SecurityFindingType("iac_misconfiguration"); + public static final SecurityFindingType IDENTITY_RISK = new SecurityFindingType("identity_risk"); + public static final SecurityFindingType LIBRARY_VULNERABILITY = + new SecurityFindingType("library_vulnerability"); + public static final SecurityFindingType MISCONFIGURATION = + new SecurityFindingType("misconfiguration"); + public static final SecurityFindingType RUNTIME_CODE_VULNERABILITY = + new SecurityFindingType("runtime_code_vulnerability"); + public static final SecurityFindingType SECRET = new SecurityFindingType("secret"); + public static final SecurityFindingType STATIC_CODE_VULNERABILITY = + new SecurityFindingType("static_code_vulnerability"); + public static final SecurityFindingType WORKLOAD_ACTIVITY = + new SecurityFindingType("workload_activity"); + + SecurityFindingType(String value) { + super(value, allowedValues); + } + + public static class SecurityFindingTypeSerializer extends StdSerializer { + public SecurityFindingTypeSerializer(Class t) { + super(t); + } + + public SecurityFindingTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SecurityFindingType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SecurityFindingType fromValue(String value) { + return new SecurityFindingType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleAction.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleAction.java new file mode 100644 index 00000000000..f2a7233f497 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleAction.java @@ -0,0 +1,267 @@ +/* + * 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; + +/** The action to take when the ticket creation rule matches a finding. */ +@JsonPropertyOrder({ + TicketCreationRuleAction.JSON_PROPERTY_ASSIGNEE_ID, + TicketCreationRuleAction.JSON_PROPERTY_FIELDS, + TicketCreationRuleAction.JSON_PROPERTY_MAX_TICKETS_PER_DAY, + TicketCreationRuleAction.JSON_PROPERTY_PROJECT_ID, + TicketCreationRuleAction.JSON_PROPERTY_TARGET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleAction { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + private UUID assigneeId; + + public static final String JSON_PROPERTY_FIELDS = "fields"; + private Object fields; + + public static final String JSON_PROPERTY_MAX_TICKETS_PER_DAY = "max_tickets_per_day"; + private Long maxTicketsPerDay; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + private UUID projectId; + + public static final String JSON_PROPERTY_TARGET = "target"; + private TicketCreationTarget target; + + public TicketCreationRuleAction() {} + + @JsonCreator + public TicketCreationRuleAction( + @JsonProperty(required = true, value = JSON_PROPERTY_MAX_TICKETS_PER_DAY) + Long maxTicketsPerDay, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT_ID) UUID projectId, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) TicketCreationTarget target) { + this.maxTicketsPerDay = maxTicketsPerDay; + this.projectId = projectId; + this.target = target; + this.unparsed |= !target.isValid(); + } + + public TicketCreationRuleAction assigneeId(UUID assigneeId) { + this.assigneeId = assigneeId; + return this; + } + + /** + * The UUID of the default assignee for created tickets. + * + * @return assigneeId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAssigneeId() { + return assigneeId; + } + + public void setAssigneeId(UUID assigneeId) { + this.assigneeId = assigneeId; + } + + public TicketCreationRuleAction fields(Object fields) { + this.fields = fields; + return this; + } + + /** + * Custom fields of the Jira issue to create. For the list of available fields, see Jira + * documentation. + * + * @return fields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getFields() { + return fields; + } + + public void setFields(Object fields) { + this.fields = fields; + } + + public TicketCreationRuleAction maxTicketsPerDay(Long maxTicketsPerDay) { + this.maxTicketsPerDay = maxTicketsPerDay; + return this; + } + + /** + * The maximum number of tickets the rule may create per day. If exceeded, one final ticket will + * be created, explaining the limit was hit and link back to the responsible rule. minimum: 1 + * maximum: 500 + * + * @return maxTicketsPerDay + */ + @JsonProperty(JSON_PROPERTY_MAX_TICKETS_PER_DAY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMaxTicketsPerDay() { + return maxTicketsPerDay; + } + + public void setMaxTicketsPerDay(Long maxTicketsPerDay) { + this.maxTicketsPerDay = maxTicketsPerDay; + } + + public TicketCreationRuleAction projectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + /** + * The UUID of the case management project. + * + * @return projectId + */ + @JsonProperty(JSON_PROPERTY_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getProjectId() { + return projectId; + } + + public void setProjectId(UUID projectId) { + this.projectId = projectId; + } + + public TicketCreationRuleAction target(TicketCreationTarget target) { + this.target = target; + this.unparsed |= !target.isValid(); + return this; + } + + /** + * The ticketing system to create tickets in. + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationTarget getTarget() { + return target; + } + + public void setTarget(TicketCreationTarget target) { + if (!target.isValid()) { + this.unparsed = true; + } + this.target = target; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleAction + */ + @JsonAnySetter + public TicketCreationRuleAction putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleAction object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleAction ticketCreationRuleAction = (TicketCreationRuleAction) o; + return Objects.equals(this.assigneeId, ticketCreationRuleAction.assigneeId) + && Objects.equals(this.fields, ticketCreationRuleAction.fields) + && Objects.equals(this.maxTicketsPerDay, ticketCreationRuleAction.maxTicketsPerDay) + && Objects.equals(this.projectId, ticketCreationRuleAction.projectId) + && Objects.equals(this.target, ticketCreationRuleAction.target) + && Objects.equals(this.additionalProperties, ticketCreationRuleAction.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + assigneeId, fields, maxTicketsPerDay, projectId, target, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleAction {\n"); + sb.append(" assigneeId: ").append(toIndentedString(assigneeId)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" maxTicketsPerDay: ").append(toIndentedString(maxTicketsPerDay)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/TicketCreationRuleActionResponse.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleActionResponse.java new file mode 100644 index 00000000000..d59f92bee98 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleActionResponse.java @@ -0,0 +1,304 @@ +/* + * 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; + +/** The action to take when the ticket creation rule matches a finding. */ +@JsonPropertyOrder({ + TicketCreationRuleActionResponse.JSON_PROPERTY_ASSIGNEE_ID, + TicketCreationRuleActionResponse.JSON_PROPERTY_AUTO_DISABLED_REASON, + TicketCreationRuleActionResponse.JSON_PROPERTY_FIELDS, + TicketCreationRuleActionResponse.JSON_PROPERTY_MAX_TICKETS_PER_DAY, + TicketCreationRuleActionResponse.JSON_PROPERTY_PROJECT_ID, + TicketCreationRuleActionResponse.JSON_PROPERTY_TARGET +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleActionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSIGNEE_ID = "assignee_id"; + private UUID assigneeId; + + public static final String JSON_PROPERTY_AUTO_DISABLED_REASON = "auto_disabled_reason"; + private String autoDisabledReason; + + public static final String JSON_PROPERTY_FIELDS = "fields"; + private Object fields; + + public static final String JSON_PROPERTY_MAX_TICKETS_PER_DAY = "max_tickets_per_day"; + private Long maxTicketsPerDay; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + private UUID projectId; + + public static final String JSON_PROPERTY_TARGET = "target"; + private TicketCreationTarget target; + + public TicketCreationRuleActionResponse() {} + + @JsonCreator + public TicketCreationRuleActionResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_MAX_TICKETS_PER_DAY) + Long maxTicketsPerDay, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECT_ID) UUID projectId, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) TicketCreationTarget target) { + this.maxTicketsPerDay = maxTicketsPerDay; + this.projectId = projectId; + this.target = target; + this.unparsed |= !target.isValid(); + } + + public TicketCreationRuleActionResponse assigneeId(UUID assigneeId) { + this.assigneeId = assigneeId; + return this; + } + + /** + * The UUID of the default assignee for created tickets. + * + * @return assigneeId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSIGNEE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getAssigneeId() { + return assigneeId; + } + + public void setAssigneeId(UUID assigneeId) { + this.assigneeId = assigneeId; + } + + public TicketCreationRuleActionResponse autoDisabledReason(String autoDisabledReason) { + this.autoDisabledReason = autoDisabledReason; + return this; + } + + /** + * The reason the rule was automatically disabled by the system due to a ticketing integration + * error. + * + * @return autoDisabledReason + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTO_DISABLED_REASON) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAutoDisabledReason() { + return autoDisabledReason; + } + + public void setAutoDisabledReason(String autoDisabledReason) { + this.autoDisabledReason = autoDisabledReason; + } + + public TicketCreationRuleActionResponse fields(Object fields) { + this.fields = fields; + return this; + } + + /** + * Custom fields of the Jira issue to create. For the list of available fields, see Jira + * documentation. + * + * @return fields + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getFields() { + return fields; + } + + public void setFields(Object fields) { + this.fields = fields; + } + + public TicketCreationRuleActionResponse maxTicketsPerDay(Long maxTicketsPerDay) { + this.maxTicketsPerDay = maxTicketsPerDay; + return this; + } + + /** + * The maximum number of tickets the rule may create per day. If exceeded, one final ticket will + * be created, explaining the limit was hit and link back to the responsible rule. minimum: 1 + * maximum: 500 + * + * @return maxTicketsPerDay + */ + @JsonProperty(JSON_PROPERTY_MAX_TICKETS_PER_DAY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMaxTicketsPerDay() { + return maxTicketsPerDay; + } + + public void setMaxTicketsPerDay(Long maxTicketsPerDay) { + this.maxTicketsPerDay = maxTicketsPerDay; + } + + public TicketCreationRuleActionResponse projectId(UUID projectId) { + this.projectId = projectId; + return this; + } + + /** + * The UUID of the case management project. + * + * @return projectId + */ + @JsonProperty(JSON_PROPERTY_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public UUID getProjectId() { + return projectId; + } + + public void setProjectId(UUID projectId) { + this.projectId = projectId; + } + + public TicketCreationRuleActionResponse target(TicketCreationTarget target) { + this.target = target; + this.unparsed |= !target.isValid(); + return this; + } + + /** + * The ticketing system to create tickets in. + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationTarget getTarget() { + return target; + } + + public void setTarget(TicketCreationTarget target) { + if (!target.isValid()) { + this.unparsed = true; + } + this.target = target; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleActionResponse + */ + @JsonAnySetter + public TicketCreationRuleActionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleActionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleActionResponse ticketCreationRuleActionResponse = + (TicketCreationRuleActionResponse) o; + return Objects.equals(this.assigneeId, ticketCreationRuleActionResponse.assigneeId) + && Objects.equals( + this.autoDisabledReason, ticketCreationRuleActionResponse.autoDisabledReason) + && Objects.equals(this.fields, ticketCreationRuleActionResponse.fields) + && Objects.equals(this.maxTicketsPerDay, ticketCreationRuleActionResponse.maxTicketsPerDay) + && Objects.equals(this.projectId, ticketCreationRuleActionResponse.projectId) + && Objects.equals(this.target, ticketCreationRuleActionResponse.target) + && Objects.equals( + this.additionalProperties, ticketCreationRuleActionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + assigneeId, + autoDisabledReason, + fields, + maxTicketsPerDay, + projectId, + target, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleActionResponse {\n"); + sb.append(" assigneeId: ").append(toIndentedString(assigneeId)).append("\n"); + sb.append(" autoDisabledReason: ").append(toIndentedString(autoDisabledReason)).append("\n"); + sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); + sb.append(" maxTicketsPerDay: ").append(toIndentedString(maxTicketsPerDay)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/TicketCreationRuleAttributesCreate.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleAttributesCreate.java new file mode 100644 index 00000000000..5d7f18cf6fd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleAttributesCreate.java @@ -0,0 +1,234 @@ +/* + * 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 for creating or updating a ticket creation rule. */ +@JsonPropertyOrder({ + TicketCreationRuleAttributesCreate.JSON_PROPERTY_ACTION, + TicketCreationRuleAttributesCreate.JSON_PROPERTY_ENABLED, + TicketCreationRuleAttributesCreate.JSON_PROPERTY_NAME, + TicketCreationRuleAttributesCreate.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleAttributesCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private TicketCreationRuleAction 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 AutomationRuleScope rule; + + public TicketCreationRuleAttributesCreate() {} + + @JsonCreator + public TicketCreationRuleAttributesCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) TicketCreationRuleAction action, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) AutomationRuleScope rule) { + this.action = action; + this.unparsed |= action.unparsed; + this.name = name; + this.rule = rule; + this.unparsed |= rule.unparsed; + } + + public TicketCreationRuleAttributesCreate action(TicketCreationRuleAction action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * The action to take when the ticket creation rule matches a finding. + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleAction getAction() { + return action; + } + + public void setAction(TicketCreationRuleAction action) { + this.action = action; + } + + public TicketCreationRuleAttributesCreate enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the ticket creation rule is enabled. + * + * @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 TicketCreationRuleAttributesCreate name(String name) { + this.name = name; + return this; + } + + /** + * The name of the ticket creation 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 TicketCreationRuleAttributesCreate rule(AutomationRuleScope rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * Defines the scope of findings to which the automation rule applies. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleScope getRule() { + return rule; + } + + public void setRule(AutomationRuleScope rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleAttributesCreate + */ + @JsonAnySetter + public TicketCreationRuleAttributesCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleAttributesCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleAttributesCreate ticketCreationRuleAttributesCreate = + (TicketCreationRuleAttributesCreate) o; + return Objects.equals(this.action, ticketCreationRuleAttributesCreate.action) + && Objects.equals(this.enabled, ticketCreationRuleAttributesCreate.enabled) + && Objects.equals(this.name, ticketCreationRuleAttributesCreate.name) + && Objects.equals(this.rule, ticketCreationRuleAttributesCreate.rule) + && Objects.equals( + this.additionalProperties, ticketCreationRuleAttributesCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, enabled, name, rule, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleAttributesCreate {\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/TicketCreationRuleAttributesResponse.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleAttributesResponse.java new file mode 100644 index 00000000000..5e32c112a60 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleAttributesResponse.java @@ -0,0 +1,363 @@ +/* + * 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 a ticket creation rule returned by the API. */ +@JsonPropertyOrder({ + TicketCreationRuleAttributesResponse.JSON_PROPERTY_ACTION, + TicketCreationRuleAttributesResponse.JSON_PROPERTY_CREATED_AT, + TicketCreationRuleAttributesResponse.JSON_PROPERTY_CREATED_BY, + TicketCreationRuleAttributesResponse.JSON_PROPERTY_ENABLED, + TicketCreationRuleAttributesResponse.JSON_PROPERTY_MODIFIED_AT, + TicketCreationRuleAttributesResponse.JSON_PROPERTY_MODIFIED_BY, + TicketCreationRuleAttributesResponse.JSON_PROPERTY_NAME, + TicketCreationRuleAttributesResponse.JSON_PROPERTY_RULE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleAttributesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private TicketCreationRuleActionResponse 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 AutomationRuleCreatedBy 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 AutomationRuleModifiedBy modifiedBy; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_RULE = "rule"; + private AutomationRuleScope rule; + + public TicketCreationRuleAttributesResponse() {} + + @JsonCreator + public TicketCreationRuleAttributesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ACTION) + TicketCreationRuleActionResponse action, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) Long createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) + AutomationRuleCreatedBy 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) + AutomationRuleModifiedBy modifiedBy, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_RULE) AutomationRuleScope 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 TicketCreationRuleAttributesResponse action(TicketCreationRuleActionResponse action) { + this.action = action; + this.unparsed |= action.unparsed; + return this; + } + + /** + * The action to take when the ticket creation rule matches a finding. + * + * @return action + */ + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleActionResponse getAction() { + return action; + } + + public void setAction(TicketCreationRuleActionResponse action) { + this.action = action; + } + + public TicketCreationRuleAttributesResponse createdAt(Long createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The Unix timestamp in milliseconds when the rule was created. + * + * @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 TicketCreationRuleAttributesResponse createdBy(AutomationRuleCreatedBy createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * The user or Datadog system who created the rule. + * + * @return createdBy + */ + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleCreatedBy getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(AutomationRuleCreatedBy createdBy) { + this.createdBy = createdBy; + } + + public TicketCreationRuleAttributesResponse enabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Whether the ticket creation rule is enabled. + * + * @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 TicketCreationRuleAttributesResponse modifiedAt(Long modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * The Unix timestamp in milliseconds when the rule was last modified. + * + * @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 TicketCreationRuleAttributesResponse modifiedBy(AutomationRuleModifiedBy modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * The user or Datadog system who last modified the rule. + * + * @return modifiedBy + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleModifiedBy getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(AutomationRuleModifiedBy modifiedBy) { + this.modifiedBy = modifiedBy; + } + + public TicketCreationRuleAttributesResponse name(String name) { + this.name = name; + return this; + } + + /** + * The name of the ticket creation 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 TicketCreationRuleAttributesResponse rule(AutomationRuleScope rule) { + this.rule = rule; + this.unparsed |= rule.unparsed; + return this; + } + + /** + * Defines the scope of findings to which the automation rule applies. + * + * @return rule + */ + @JsonProperty(JSON_PROPERTY_RULE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AutomationRuleScope getRule() { + return rule; + } + + public void setRule(AutomationRuleScope rule) { + this.rule = rule; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleAttributesResponse + */ + @JsonAnySetter + public TicketCreationRuleAttributesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleAttributesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleAttributesResponse ticketCreationRuleAttributesResponse = + (TicketCreationRuleAttributesResponse) o; + return Objects.equals(this.action, ticketCreationRuleAttributesResponse.action) + && Objects.equals(this.createdAt, ticketCreationRuleAttributesResponse.createdAt) + && Objects.equals(this.createdBy, ticketCreationRuleAttributesResponse.createdBy) + && Objects.equals(this.enabled, ticketCreationRuleAttributesResponse.enabled) + && Objects.equals(this.modifiedAt, ticketCreationRuleAttributesResponse.modifiedAt) + && Objects.equals(this.modifiedBy, ticketCreationRuleAttributesResponse.modifiedBy) + && Objects.equals(this.name, ticketCreationRuleAttributesResponse.name) + && Objects.equals(this.rule, ticketCreationRuleAttributesResponse.rule) + && Objects.equals( + this.additionalProperties, ticketCreationRuleAttributesResponse.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 TicketCreationRuleAttributesResponse {\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/TicketCreationRuleCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleCreateRequest.java new file mode 100644 index 00000000000..95c3d3f6593 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleCreateRequest.java @@ -0,0 +1,148 @@ +/* + * 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; + +/** The body of a ticket creation rule create request. */ +@JsonPropertyOrder({TicketCreationRuleCreateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleCreateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TicketCreationRuleDataCreate data; + + public TicketCreationRuleCreateRequest() {} + + @JsonCreator + public TicketCreationRuleCreateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TicketCreationRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TicketCreationRuleCreateRequest data(TicketCreationRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a ticket creation rule create or update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleDataCreate getData() { + return data; + } + + public void setData(TicketCreationRuleDataCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleCreateRequest + */ + @JsonAnySetter + public TicketCreationRuleCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleCreateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleCreateRequest ticketCreationRuleCreateRequest = + (TicketCreationRuleCreateRequest) o; + return Objects.equals(this.data, ticketCreationRuleCreateRequest.data) + && Objects.equals( + this.additionalProperties, ticketCreationRuleCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleCreateRequest {\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/TicketCreationRuleDataCreate.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleDataCreate.java new file mode 100644 index 00000000000..386f84c9191 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleDataCreate.java @@ -0,0 +1,182 @@ +/* + * 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; + +/** The data object for a ticket creation rule create or update request. */ +@JsonPropertyOrder({ + TicketCreationRuleDataCreate.JSON_PROPERTY_ATTRIBUTES, + TicketCreationRuleDataCreate.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleDataCreate { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TicketCreationRuleAttributesCreate attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TicketCreationRuleType type; + + public TicketCreationRuleDataCreate() {} + + @JsonCreator + public TicketCreationRuleDataCreate( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TicketCreationRuleAttributesCreate attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TicketCreationRuleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TicketCreationRuleDataCreate attributes(TicketCreationRuleAttributesCreate attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating or updating a ticket creation rule. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleAttributesCreate getAttributes() { + return attributes; + } + + public void setAttributes(TicketCreationRuleAttributesCreate attributes) { + this.attributes = attributes; + } + + public TicketCreationRuleDataCreate type(TicketCreationRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for ticket creation rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleType getType() { + return type; + } + + public void setType(TicketCreationRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleDataCreate + */ + @JsonAnySetter + public TicketCreationRuleDataCreate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleDataCreate object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleDataCreate ticketCreationRuleDataCreate = (TicketCreationRuleDataCreate) o; + return Objects.equals(this.attributes, ticketCreationRuleDataCreate.attributes) + && Objects.equals(this.type, ticketCreationRuleDataCreate.type) + && Objects.equals( + this.additionalProperties, ticketCreationRuleDataCreate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleDataCreate {\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/TicketCreationRuleDataResponse.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleDataResponse.java new file mode 100644 index 00000000000..5e5576cdbd4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleDataResponse.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; + +/** The data object for a ticket creation rule returned by the API. */ +@JsonPropertyOrder({ + TicketCreationRuleDataResponse.JSON_PROPERTY_ATTRIBUTES, + TicketCreationRuleDataResponse.JSON_PROPERTY_ID, + TicketCreationRuleDataResponse.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleDataResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TicketCreationRuleAttributesResponse attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private UUID id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TicketCreationRuleType type; + + public TicketCreationRuleDataResponse() {} + + @JsonCreator + public TicketCreationRuleDataResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TicketCreationRuleAttributesResponse attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TicketCreationRuleType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TicketCreationRuleDataResponse attributes( + TicketCreationRuleAttributesResponse attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a ticket creation rule returned by the API. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleAttributesResponse getAttributes() { + return attributes; + } + + public void setAttributes(TicketCreationRuleAttributesResponse attributes) { + this.attributes = attributes; + } + + public TicketCreationRuleDataResponse id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the ticket creation 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 TicketCreationRuleDataResponse type(TicketCreationRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for ticket creation rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleType getType() { + return type; + } + + public void setType(TicketCreationRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleDataResponse + */ + @JsonAnySetter + public TicketCreationRuleDataResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleDataResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleDataResponse ticketCreationRuleDataResponse = + (TicketCreationRuleDataResponse) o; + return Objects.equals(this.attributes, ticketCreationRuleDataResponse.attributes) + && Objects.equals(this.id, ticketCreationRuleDataResponse.id) + && Objects.equals(this.type, ticketCreationRuleDataResponse.type) + && Objects.equals( + this.additionalProperties, ticketCreationRuleDataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleDataResponse {\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/TicketCreationRuleReorderItem.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleReorderItem.java new file mode 100644 index 00000000000..b7d41d91126 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleReorderItem.java @@ -0,0 +1,180 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; + +/** A reference to a ticket creation rule used for reordering. */ +@JsonPropertyOrder({ + TicketCreationRuleReorderItem.JSON_PROPERTY_ID, + TicketCreationRuleReorderItem.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleReorderItem { + @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 TicketCreationRuleType type; + + public TicketCreationRuleReorderItem() {} + + @JsonCreator + public TicketCreationRuleReorderItem( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) UUID id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TicketCreationRuleType type) { + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TicketCreationRuleReorderItem id(UUID id) { + this.id = id; + return this; + } + + /** + * The ID of the automation 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 TicketCreationRuleReorderItem type(TicketCreationRuleType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The JSON:API type for ticket creation rules. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleType getType() { + return type; + } + + public void setType(TicketCreationRuleType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleReorderItem + */ + @JsonAnySetter + public TicketCreationRuleReorderItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleReorderItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleReorderItem ticketCreationRuleReorderItem = (TicketCreationRuleReorderItem) o; + return Objects.equals(this.id, ticketCreationRuleReorderItem.id) + && Objects.equals(this.type, ticketCreationRuleReorderItem.type) + && Objects.equals( + this.additionalProperties, ticketCreationRuleReorderItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleReorderItem {\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/TicketCreationRuleReorderRequest.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleReorderRequest.java new file mode 100644 index 00000000000..4d6ebab4e6b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleReorderRequest.java @@ -0,0 +1,157 @@ +/* + * 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 body of the ticket creation rule reorder request. */ +@JsonPropertyOrder({TicketCreationRuleReorderRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleReorderRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public TicketCreationRuleReorderRequest() {} + + @JsonCreator + public TicketCreationRuleReorderRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data) { + this.data = data; + } + + public TicketCreationRuleReorderRequest data(List data) { + this.data = data; + for (TicketCreationRuleReorderItem item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TicketCreationRuleReorderRequest addDataItem(TicketCreationRuleReorderItem dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The ordered list of all ticket creation rules; every rule must be included. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleReorderRequest + */ + @JsonAnySetter + public TicketCreationRuleReorderRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleReorderRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleReorderRequest ticketCreationRuleReorderRequest = + (TicketCreationRuleReorderRequest) o; + return Objects.equals(this.data, ticketCreationRuleReorderRequest.data) + && Objects.equals( + this.additionalProperties, ticketCreationRuleReorderRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleReorderRequest {\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/TicketCreationRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleResponse.java new file mode 100644 index 00000000000..b461ff88103 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleResponse.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A single ticket creation rule response. */ +@JsonPropertyOrder({TicketCreationRuleResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TicketCreationRuleDataResponse data; + + public TicketCreationRuleResponse() {} + + @JsonCreator + public TicketCreationRuleResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TicketCreationRuleDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TicketCreationRuleResponse data(TicketCreationRuleDataResponse data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a ticket creation rule returned by the API. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleDataResponse getData() { + return data; + } + + public void setData(TicketCreationRuleDataResponse data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleResponse + */ + @JsonAnySetter + public TicketCreationRuleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleResponse ticketCreationRuleResponse = (TicketCreationRuleResponse) o; + return Objects.equals(this.data, ticketCreationRuleResponse.data) + && Objects.equals( + this.additionalProperties, ticketCreationRuleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleResponse {\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/TicketCreationRuleType.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleType.java new file mode 100644 index 00000000000..cac62ce5507 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleType.java @@ -0,0 +1,57 @@ +/* + * 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 JSON:API type for ticket creation rules. */ +@JsonSerialize(using = TicketCreationRuleType.TicketCreationRuleTypeSerializer.class) +public class TicketCreationRuleType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("ticket_creation_rules")); + + public static final TicketCreationRuleType TICKET_CREATION_RULES = + new TicketCreationRuleType("ticket_creation_rules"); + + TicketCreationRuleType(String value) { + super(value, allowedValues); + } + + public static class TicketCreationRuleTypeSerializer + extends StdSerializer { + public TicketCreationRuleTypeSerializer(Class t) { + super(t); + } + + public TicketCreationRuleTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TicketCreationRuleType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TicketCreationRuleType fromValue(String value) { + return new TicketCreationRuleType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleUpdateRequest.java new file mode 100644 index 00000000000..9ec309bf6c3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRuleUpdateRequest.java @@ -0,0 +1,148 @@ +/* + * 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; + +/** The body of a ticket creation rule update request. */ +@JsonPropertyOrder({TicketCreationRuleUpdateRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRuleUpdateRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TicketCreationRuleDataCreate data; + + public TicketCreationRuleUpdateRequest() {} + + @JsonCreator + public TicketCreationRuleUpdateRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TicketCreationRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TicketCreationRuleUpdateRequest data(TicketCreationRuleDataCreate data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * The data object for a ticket creation rule create or update request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TicketCreationRuleDataCreate getData() { + return data; + } + + public void setData(TicketCreationRuleDataCreate data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRuleUpdateRequest + */ + @JsonAnySetter + public TicketCreationRuleUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRuleUpdateRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRuleUpdateRequest ticketCreationRuleUpdateRequest = + (TicketCreationRuleUpdateRequest) o; + return Objects.equals(this.data, ticketCreationRuleUpdateRequest.data) + && Objects.equals( + this.additionalProperties, ticketCreationRuleUpdateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRuleUpdateRequest {\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/TicketCreationRulesResponse.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRulesResponse.java new file mode 100644 index 00000000000..f8cd9bbdecb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationRulesResponse.java @@ -0,0 +1,219 @@ +/* + * 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; + +/** A list of ticket creation rules with pagination metadata. */ +@JsonPropertyOrder({ + TicketCreationRulesResponse.JSON_PROPERTY_DATA, + TicketCreationRulesResponse.JSON_PROPERTY_LINKS, + TicketCreationRulesResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TicketCreationRulesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_LINKS = "links"; + private SecurityAutomationRulesLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private SecurityAutomationRulesMeta meta; + + public TicketCreationRulesResponse() {} + + @JsonCreator + public TicketCreationRulesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data, + @JsonProperty(required = true, value = JSON_PROPERTY_LINKS) + SecurityAutomationRulesLinks links, + @JsonProperty(required = true, value = JSON_PROPERTY_META) SecurityAutomationRulesMeta meta) { + this.data = data; + this.links = links; + this.unparsed |= links.unparsed; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public TicketCreationRulesResponse data(List data) { + this.data = data; + for (TicketCreationRuleDataResponse item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public TicketCreationRulesResponse addDataItem(TicketCreationRuleDataResponse dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * A list of ticket creation rule data objects. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public TicketCreationRulesResponse links(SecurityAutomationRulesLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Pagination links for the list of automation rules. + * + * @return links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SecurityAutomationRulesLinks getLinks() { + return links; + } + + public void setLinks(SecurityAutomationRulesLinks links) { + this.links = links; + } + + public TicketCreationRulesResponse meta(SecurityAutomationRulesMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for the list of automation rules. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SecurityAutomationRulesMeta getMeta() { + return meta; + } + + public void setMeta(SecurityAutomationRulesMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TicketCreationRulesResponse + */ + @JsonAnySetter + public TicketCreationRulesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TicketCreationRulesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TicketCreationRulesResponse ticketCreationRulesResponse = (TicketCreationRulesResponse) o; + return Objects.equals(this.data, ticketCreationRulesResponse.data) + && Objects.equals(this.links, ticketCreationRulesResponse.links) + && Objects.equals(this.meta, ticketCreationRulesResponse.meta) + && Objects.equals( + this.additionalProperties, ticketCreationRulesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TicketCreationRulesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/TicketCreationTarget.java b/src/main/java/com/datadog/api/client/v2/model/TicketCreationTarget.java new file mode 100644 index 00000000000..f4c50f1c049 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TicketCreationTarget.java @@ -0,0 +1,57 @@ +/* + * 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 ticketing system to create tickets in. */ +@JsonSerialize(using = TicketCreationTarget.TicketCreationTargetSerializer.class) +public class TicketCreationTarget extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("jira", "case_management")); + + public static final TicketCreationTarget JIRA = new TicketCreationTarget("jira"); + public static final TicketCreationTarget CASE_MANAGEMENT = + new TicketCreationTarget("case_management"); + + TicketCreationTarget(String value) { + super(value, allowedValues); + } + + public static class TicketCreationTargetSerializer extends StdSerializer { + public TicketCreationTargetSerializer(Class t) { + super(t); + } + + public TicketCreationTargetSerializer() { + this(null); + } + + @Override + public void serialize( + TicketCreationTarget value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TicketCreationTarget fromValue(String value) { + return new TicketCreationTarget(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response.freeze new file mode 100644 index 00000000000..f80d953763d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:00.178Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response.json b/src/test/resources/cassettes/features/v2/Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response.json new file mode 100644 index 00000000000..8ef65c983ab --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"due_in_days\":7,\"severity\":\"critical\"}],\"due_from\":\"first_seen\"},\"enabled\":true,\"name\":\"Test-Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response-1781624460\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"due_date_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/due_date_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"51eb64b5-a519-408a-961a-137e4fe31d3c\",\"type\":\"due_date_rules\",\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"severity\":\"critical\",\"due_in_days\":7}],\"due_from\":\"first_seen\"},\"created_at\":1781624462372,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624462372,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response-1781624460\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ebfb2a42-bade-48cc-247b-105afdde25cd" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/due_date_rules/51eb64b5-a519-408a-961a-137e4fe31d3c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "e3887155-5662-7f0e-8191-c6d88dbb4799" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response.freeze new file mode 100644 index 00000000000..43ceab11038 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:02.989Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response.json b/src/test/resources/cassettes/features/v2/Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response.json new file mode 100644 index 00000000000..4b49e6c0871 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"enabled\":true,\"name\":\"Test-Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response-1781624462\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"a23423e0-da14-4698-9c01-7897eb56b76c\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"created_at\":1781624463227,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624463227,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response-1781624462\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "08628b8a-26ed-da34-c045-92a3e0158c1e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/mute_rules/a23423e0-da14-4698-9c01-7897eb56b76c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "ac00630a-2b26-759e-15d5-a64fd1b03ae7" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response.freeze b/src/test/resources/cassettes/features/v2/Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response.freeze new file mode 100644 index 00000000000..65bc80d9bdd --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:03.837Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response.json b/src/test/resources/cassettes/features/v2/Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response.json new file mode 100644 index 00000000000..83a00b4470d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response.json @@ -0,0 +1,53 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"max_tickets_per_day\":10,\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\"},\"enabled\":true,\"name\":\"Test-Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response-1781624463\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"ticket_creation_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/ticket_creation_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"c24fb7cb-e877-491e-ae6e-2e8676b20dcb\",\"type\":\"ticket_creation_rules\",\"attributes\":{\"action\":{\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\",\"max_tickets_per_day\":10},\"created_at\":1781624464096,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624464096,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response-1781624463\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "023e89d1-6540-57c3-8126-38c4ec55901a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/c24fb7cb-e877-491e-ae6e-2e8676b20dcb", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "144b3e6d-665e-ba8b-bbc1-9ba02f4ddab9" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_due_date_rule_returns_Rule_successfully_deleted_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_due_date_rule_returns_Rule_successfully_deleted_response.freeze new file mode 100644 index 00000000000..a1ce4018598 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_due_date_rule_returns_Rule_successfully_deleted_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:04.669Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_due_date_rule_returns_Rule_successfully_deleted_response.json b/src/test/resources/cassettes/features/v2/Delete_a_due_date_rule_returns_Rule_successfully_deleted_response.json new file mode 100644 index 00000000000..399636cb594 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_due_date_rule_returns_Rule_successfully_deleted_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"due_in_days\":7,\"severity\":\"critical\"}],\"due_from\":\"first_seen\"},\"enabled\":true,\"name\":\"Test-Delete_a_due_date_rule_returns_Rule_successfully_deleted_response-1781624464\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"due_date_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/due_date_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"139c64ad-97f6-4b26-8579-05a2e2792b6c\",\"type\":\"due_date_rules\",\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"severity\":\"critical\",\"due_in_days\":7}],\"due_from\":\"first_seen\"},\"created_at\":1781624464907,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624464907,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Delete_a_due_date_rule_returns_Rule_successfully_deleted_response-1781624464\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "4131754f-9e17-5da9-001d-9cf813d8487f" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/due_date_rules/139c64ad-97f6-4b26-8579-05a2e2792b6c", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "c6822ec3-1f37-327d-4bf7-b3e74bc85e0a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/due_date_rules/139c64ad-97f6-4b26-8579-05a2e2792b6c", + "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": "c6822ec3-1f37-327d-4bf7-b3e74bc85e0b" + } +] \ 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..09f9f0ac519 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_mute_rule_returns_Rule_successfully_deleted_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:05.734Z \ 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..799168e9ae5 --- /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\":\"risk_accepted\"},\"enabled\":true,\"name\":\"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1781624465\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"03c9e010-5a46-40b2-af26-5ff613828897\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"created_at\":1781624465962,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624465962,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1781624465\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8b01cf22-2243-3050-e33c-331a17f63d2b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/mute_rules/03c9e010-5a46-40b2-af26-5ff613828897", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9d8d8b39-5bde-0cf4-b18b-a3dce716aca3" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/mute_rules/03c9e010-5a46-40b2-af26-5ff613828897", + "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": "9d8d8b39-5bde-0cf4-b18b-a3dce716aca4" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response.freeze b/src/test/resources/cassettes/features/v2/Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response.freeze new file mode 100644 index 00000000000..6ce75cad4ac --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:06.806Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response.json b/src/test/resources/cassettes/features/v2/Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response.json new file mode 100644 index 00000000000..7c2cd6db64b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"max_tickets_per_day\":10,\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\"},\"enabled\":true,\"name\":\"Test-Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response-1781624466\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"ticket_creation_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/ticket_creation_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"6b2c813c-cd92-4531-b4aa-f79e1194bcb2\",\"type\":\"ticket_creation_rules\",\"attributes\":{\"action\":{\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\",\"max_tickets_per_day\":10},\"created_at\":1781624467064,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624467064,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response-1781624466\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "fc0e246f-2dca-9c8e-8ad6-1612e7ce583b" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/6b2c813c-cd92-4531-b4aa-f79e1194bcb2", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "64dc4021-14cb-7e70-3452-212e71f66385" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/6b2c813c-cd92-4531-b4aa-f79e1194bcb2", + "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": "64dc4021-14cb-7e70-3452-212e71f66386" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response.freeze new file mode 100644 index 00000000000..55413b6c7b7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:07.946Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response.json b/src/test/resources/cassettes/features/v2/Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response.json new file mode 100644 index 00000000000..f5b157fd232 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"due_in_days\":7,\"severity\":\"critical\"}],\"due_from\":\"first_seen\"},\"enabled\":true,\"name\":\"Test-Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response-1781624467\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"due_date_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/due_date_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"7842abcf-795f-47cd-b6ba-6e05790668d5\",\"type\":\"due_date_rules\",\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"severity\":\"critical\",\"due_in_days\":7}],\"due_from\":\"first_seen\"},\"created_at\":1781624468200,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624468200,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response-1781624467\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "35d47c5f-7714-f2ef-a1c4-8a46fd47c451" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/findings/automation/due_date_rules/7842abcf-795f-47cd-b6ba-6e05790668d5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"7842abcf-795f-47cd-b6ba-6e05790668d5\",\"type\":\"due_date_rules\",\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"severity\":\"critical\",\"due_in_days\":7}],\"due_from\":\"first_seen\"},\"created_at\":1781624468200,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624468200,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response-1781624467\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "42a9e4db-f4a9-2e55-0a70-d40def427545" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/due_date_rules/7842abcf-795f-47cd-b6ba-6e05790668d5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8cdeedaa-cf87-dad6-85b6-1c75eedc7fdd" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response.freeze new file mode 100644 index 00000000000..865b604abfc --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:09.039Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response.json b/src/test/resources/cassettes/features/v2/Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response.json new file mode 100644 index 00000000000..45ed29e686a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"enabled\":true,\"name\":\"Test-Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response-1781624469\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"66330741-04f8-43cc-8cd0-a4840a593658\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"created_at\":1781624469277,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624469277,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response-1781624469\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "5bff7cf7-f4d2-826a-bd2d-488884e1dea6" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/findings/automation/mute_rules/66330741-04f8-43cc-8cd0-a4840a593658", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"66330741-04f8-43cc-8cd0-a4840a593658\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"created_at\":1781624469277,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624469277,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response-1781624469\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1eb1a165-08d6-e888-7c25-0f71a309acca" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/mute_rules/66330741-04f8-43cc-8cd0-a4840a593658", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d8b2e8f6-e108-0fcd-1833-dbdff2907826" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response.freeze b/src/test/resources/cassettes/features/v2/Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response.freeze new file mode 100644 index 00000000000..392abe6d03d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:10.163Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response.json b/src/test/resources/cassettes/features/v2/Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response.json new file mode 100644 index 00000000000..46f7348edd0 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"max_tickets_per_day\":10,\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\"},\"enabled\":true,\"name\":\"Test-Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response-1781624470\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"ticket_creation_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/ticket_creation_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"065f00af-171c-4ecc-853d-ddb4c8e30c7b\",\"type\":\"ticket_creation_rules\",\"attributes\":{\"action\":{\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\",\"max_tickets_per_day\":10},\"created_at\":1781624470412,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624470412,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response-1781624470\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cd0cf842-f364-b06c-b97e-c58cffd226df" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/065f00af-171c-4ecc-853d-ddb4c8e30c7b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"065f00af-171c-4ecc-853d-ddb4c8e30c7b\",\"type\":\"ticket_creation_rules\",\"attributes\":{\"action\":{\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\",\"max_tickets_per_day\":10},\"created_at\":1781624470412,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624470412,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response-1781624470\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "8984d900-9504-ee3d-93f4-024f7cbc0be5" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/065f00af-171c-4ecc-853d-ddb4c8e30c7b", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0edbd19b-b16b-47d4-50e3-f3ff1978feeb" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response.freeze new file mode 100644 index 00000000000..2f74959337e --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:11.482Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response.json b/src/test/resources/cassettes/features/v2/Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response.json new file mode 100644 index 00000000000..d603e58bf51 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"due_in_days\":7,\"severity\":\"critical\"}],\"due_from\":\"first_seen\"},\"enabled\":true,\"name\":\"Test-Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response-1781624471\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"due_date_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/due_date_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"1c8622b9-591f-472c-97ff-cac4c5a7cfe5\",\"type\":\"due_date_rules\",\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"severity\":\"critical\",\"due_in_days\":7}],\"due_from\":\"first_seen\"},\"created_at\":1781624471720,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624471720,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response-1781624471\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cec423f0-11b1-338a-f979-9ce52aa80ab6" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/findings/automation/due_date_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"1c8622b9-591f-472c-97ff-cac4c5a7cfe5\",\"type\":\"due_date_rules\",\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"severity\":\"critical\",\"due_in_days\":7}],\"due_from\":\"first_seen\"},\"created_at\":1781624471720,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624471720,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response-1781624471\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}],\"meta\":{\"page\":{\"total_filtered_count\":1}},\"links\":{\"first\":\"/api/v2/security/findings/automation/due_date_rules?page[size]=1000\\u0026page[number]=0\",\"last\":\"/api/v2/security/findings/automation/due_date_rules?page[size]=1000\\u0026page[number]=0\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "06b71f27-f815-0235-1df9-4a80a902a8a7" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/due_date_rules/1c8622b9-591f-472c-97ff-cac4c5a7cfe5", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d60331a4-d2ac-01f7-5556-7b95dd54ac16" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response.freeze new file mode 100644 index 00000000000..89c620816ba --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:12.599Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response.json b/src/test/resources/cassettes/features/v2/Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response.json new file mode 100644 index 00000000000..b7bcd57507d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"enabled\":true,\"name\":\"Test-Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response-1781624472\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"4c72a302-c7c8-42bc-986a-f196580240c3\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"created_at\":1781624472865,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624472865,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response-1781624472\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "55c2d89a-6d2a-b284-0fc5-695caf470eb3" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/findings/automation/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"4c72a302-c7c8-42bc-986a-f196580240c3\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"created_at\":1781624472865,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624472865,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response-1781624472\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}],\"meta\":{\"page\":{\"total_filtered_count\":1}},\"links\":{\"first\":\"/api/v2/security/findings/automation/mute_rules?page[size]=1000\\u0026page[number]=0\",\"last\":\"/api/v2/security/findings/automation/mute_rules?page[size]=1000\\u0026page[number]=0\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2161f5be-0318-dfea-ec02-4de78a1c8dc3" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/mute_rules/4c72a302-c7c8-42bc-986a-f196580240c3", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "79402cb1-0e7d-6780-2299-8f844dc87613" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_response.freeze b/src/test/resources/cassettes/features/v2/Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_response.freeze new file mode 100644 index 00000000000..f3b009f9109 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:13.714Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_response.json b/src/test/resources/cassettes/features/v2/Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_response.json new file mode 100644 index 00000000000..0b8fdf25220 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_response.json @@ -0,0 +1,79 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"max_tickets_per_day\":10,\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\"},\"enabled\":true,\"name\":\"Test-Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_respo-1781624473\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"ticket_creation_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/ticket_creation_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"399d69c3-6fcd-4538-b0cc-05e6db5aac38\",\"type\":\"ticket_creation_rules\",\"attributes\":{\"action\":{\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\",\"max_tickets_per_day\":10},\"created_at\":1781624473944,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624473944,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_respo-1781624473\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1053fa7c-4d28-67a1-0e0c-68f15463818a" + }, + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/findings/automation/ticket_creation_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"id\":\"399d69c3-6fcd-4538-b0cc-05e6db5aac38\",\"type\":\"ticket_creation_rules\",\"attributes\":{\"action\":{\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\",\"max_tickets_per_day\":10},\"created_at\":1781624473944,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624473944,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_respo-1781624473\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}],\"meta\":{\"page\":{\"total_filtered_count\":1}},\"links\":{\"first\":\"/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000\\u0026page[number]=0\",\"last\":\"/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000\\u0026page[number]=0\"}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "cc24b62d-d374-33ce-171b-753a3644799e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/399d69c3-6fcd-4538-b0cc-05e6db5aac38", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b40b5bd7-4984-4e68-a26d-b3867a45f8e5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response.freeze b/src/test/resources/cassettes/features/v2/Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response.freeze new file mode 100644 index 00000000000..c7ce8f75a46 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:14.824Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response.json b/src/test/resources/cassettes/features/v2/Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response.json new file mode 100644 index 00000000000..7b926f2b8d9 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"due_in_days\":7,\"severity\":\"critical\"}],\"due_from\":\"first_seen\"},\"enabled\":true,\"name\":\"Test-Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response-1781624474\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"due_date_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/due_date_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"64e53941-8eba-42f9-946b-6422bead1eea\",\"type\":\"due_date_rules\",\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"severity\":\"critical\",\"due_in_days\":7}],\"due_from\":\"first_seen\"},\"created_at\":1781624475039,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624475039,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response-1781624474\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3e64cb84-0b54-30a1-31a4-9c062251d292" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"id\":\"64e53941-8eba-42f9-946b-6422bead1eea\",\"type\":\"due_date_rules\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/due_date_rules/reorder", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"type\":\"due_date_rules\",\"id\":\"64e53941-8eba-42f9-946b-6422bead1eea\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9b83e75f-76ae-f2e1-5da9-9fe884e2db45" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/due_date_rules/64e53941-8eba-42f9-946b-6422bead1eea", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "9cc84bff-536c-80a0-0981-9a53e20942bb" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response.freeze b/src/test/resources/cassettes/features/v2/Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response.freeze new file mode 100644 index 00000000000..a7c62ff9756 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:16.028Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response.json b/src/test/resources/cassettes/features/v2/Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response.json new file mode 100644 index 00000000000..9160380ffc2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"enabled\":true,\"name\":\"Test-Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response-1781624476\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"707a25e7-57ae-4d8f-9ce8-4840b52c7349\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"created_at\":1781624476249,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624476249,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response-1781624476\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "dbd86397-0c15-a94f-ecb2-2e4cb78e9bdd" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"id\":\"707a25e7-57ae-4d8f-9ce8-4840b52c7349\",\"type\":\"mute_rules\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/mute_rules/reorder", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"type\":\"mute_rules\",\"id\":\"707a25e7-57ae-4d8f-9ce8-4840b52c7349\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a9de8cc1-2f2c-2cc9-8937-17522642132e" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/mute_rules/707a25e7-57ae-4d8f-9ce8-4840b52c7349", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "f0bc78b8-787d-8c93-6135-bd543c1cb2e5" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response.freeze b/src/test/resources/cassettes/features/v2/Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response.freeze new file mode 100644 index 00000000000..f5acdf623f2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:17.183Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response.json b/src/test/resources/cassettes/features/v2/Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response.json new file mode 100644 index 00000000000..e80c8fb514b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"max_tickets_per_day\":10,\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\"},\"enabled\":true,\"name\":\"Test-Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response-1781624477\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"ticket_creation_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/ticket_creation_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"b34dcd68-976a-49af-915b-83488a3d9f74\",\"type\":\"ticket_creation_rules\",\"attributes\":{\"action\":{\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\",\"max_tickets_per_day\":10},\"created_at\":1781624477424,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624477424,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response-1781624477\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "1fb27fff-5272-6166-0257-d2f9bc94c283" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":[{\"id\":\"b34dcd68-976a-49af-915b-83488a3d9f74\",\"type\":\"ticket_creation_rules\"}]}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/reorder", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"type\":\"ticket_creation_rules\",\"id\":\"b34dcd68-976a-49af-915b-83488a3d9f74\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6b5f2508-023d-9a8e-3a18-ad487611736a" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/b34dcd68-976a-49af-915b-83488a3d9f74", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "0ae2c5c1-8613-d50c-1e50-b1bf20aa32dd" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response.freeze new file mode 100644 index 00000000000..c0e1f30ef56 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:18.417Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response.json b/src/test/resources/cassettes/features/v2/Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response.json new file mode 100644 index 00000000000..d523f5212c2 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"due_in_days\":7,\"severity\":\"critical\"}],\"due_from\":\"first_seen\"},\"enabled\":true,\"name\":\"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"due_date_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/due_date_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"22df6980-9710-496d-bf46-85e0ac181dc0\",\"type\":\"due_date_rules\",\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"severity\":\"critical\",\"due_in_days\":7}],\"due_from\":\"first_seen\"},\"created_at\":1781624478629,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624478629,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "239060fc-ab64-9c73-7641-9aa4f0a43c41" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"due_in_days\":14,\"severity\":\"critical\"}],\"due_from\":\"first_seen\"},\"enabled\":false,\"name\":\"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"due_date_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/findings/automation/due_date_rules/22df6980-9710-496d-bf46-85e0ac181dc0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"22df6980-9710-496d-bf46-85e0ac181dc0\",\"type\":\"due_date_rules\",\"attributes\":{\"action\":{\"due_days_per_severity\":[{\"severity\":\"critical\",\"due_in_days\":14}],\"due_from\":\"first_seen\"},\"created_at\":1781624478629,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":false,\"modified_at\":1781624479036,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3bc2d6f1-3bc2-ffd7-893a-9c83692176ca" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/due_date_rules/22df6980-9710-496d-bf46-85e0ac181dc0", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "b9d56867-a8f1-e9d5-1d86-cb7cb5199ce0" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response.freeze new file mode 100644 index 00000000000..9c2202dcbff --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:19.612Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response.json b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response.json new file mode 100644 index 00000000000..cbc296d7d55 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"enabled\":true,\"name\":\"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/mute_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"risk_accepted\"},\"created_at\":1781624479894,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624479894,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "2accd935-f7c9-bdbb-3b0d-e22d792bf4b0" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"reason\":\"false_positive\"},\"enabled\":false,\"name\":\"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"mute_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/findings/automation/mute_rules/9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9\",\"type\":\"mute_rules\",\"attributes\":{\"action\":{\"reason\":\"false_positive\"},\"created_at\":1781624479894,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":false,\"modified_at\":1781624480318,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "91a47cb5-f80d-82e4-4778-d06b8748cf54" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/mute_rules/9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "904dc5cc-94dc-6984-d25e-5610f07bad19" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response.freeze b/src/test/resources/cassettes/features/v2/Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response.freeze new file mode 100644 index 00000000000..1bf1e4fadbe --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response.freeze @@ -0,0 +1 @@ +2026-06-16T15:41:20.880Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response.json b/src/test/resources/cassettes/features/v2/Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response.json new file mode 100644 index 00000000000..f46f0268375 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response.json @@ -0,0 +1,83 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"max_tickets_per_day\":10,\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\"},\"enabled\":true,\"name\":\"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"ticket_creation_rules\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/security/findings/automation/ticket_creation_rules", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"d3fcec39-567f-4450-967e-ca83bb29dbe4\",\"type\":\"ticket_creation_rules\",\"attributes\":{\"action\":{\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\",\"max_tickets_per_day\":10},\"created_at\":1781624481109,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":true,\"modified_at\":1781624481109,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 201, + "reasonPhrase": "Created" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "813c3df0-7b77-de4c-9a24-4264ff91ea05" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"action\":{\"max_tickets_per_day\":5,\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\"},\"enabled\":false,\"name\":\"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}},\"type\":\"ticket_creation_rules\"}}" + }, + "headers": {}, + "method": "PUT", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/d3fcec39-567f-4450-967e-ca83bb29dbe4", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"d3fcec39-567f-4450-967e-ca83bb29dbe4\",\"type\":\"ticket_creation_rules\",\"attributes\":{\"action\":{\"project_id\":\"11111111-1111-1111-1111-111111111111\",\"target\":\"jira\",\"max_tickets_per_day\":5},\"created_at\":1781624481109,\"created_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"enabled\":false,\"modified_at\":1781624481511,\"modified_by\":{\"type\":\"user\",\"id\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"name\":\"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480\",\"rule\":{\"finding_types\":[\"misconfiguration\"],\"query\":\"env:staging\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "42dcaffb-72a5-68e5-8b9a-a21b478dba46" + }, + { + "httpRequest": { + "headers": {}, + "method": "DELETE", + "path": "/api/v2/security/findings/automation/ticket_creation_rules/d3fcec39-567f-4450-967e-ca83bb29dbe4", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "headers": {}, + "statusCode": 204, + "reasonPhrase": "No Content" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "d27a2ecd-6c1c-9456-5e76-87977b055ee4" + } +] \ 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 f5ce3365dab..0f9de6d48a2 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 @@ -1290,6 +1290,42 @@ "tag": "Scorecards", "operationId": "CreateScorecardRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"due_date_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"due_days_per_severity\": [\n {\"severity\": \"critical\", \"due_in_days\": 7}\n ],\n \"due_from\": \"first_seen\"\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_due_date_rule\" in the system", + "key": "valid_due_date_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationDueDateRule" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"mute_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"reason\": \"risk_accepted\"\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_mute_rule\" in the system", + "key": "valid_mute_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationMuteRule" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"ticket_creation_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"project_id\": \"11111111-1111-1111-1111-111111111111\",\n \"target\": \"jira\",\n \"max_tickets_per_day\": 10\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_ticket_creation_rule\" in the system", + "key": "valid_ticket_creation_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationTicketCreationRule" + }, { "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 dd064c2a4a6..0c14124aaec 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 @@ -756,6 +756,60 @@ Feature: Security Monitoring And the response "message" is equal to "Test rule" And the response "isEnabled" is equal to true + @generated @skip @team:DataDog/k9-automation + Scenario: Create a due date rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationDueDateRule" enabled + And new "CreateSecurityFindingsAutomationDueDateRule" request + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Create a due date rule returns "Successfully created the due date rule" response + Given operation "CreateSecurityFindingsAutomationDueDateRule" enabled + And new "CreateSecurityFindingsAutomationDueDateRule" request + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 201 Successfully created the due date rule + And the response "data.type" is equal to "due_date_rules" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.enabled" is equal to true + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a due date rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationDueDateRule" enabled + And new "CreateSecurityFindingsAutomationDueDateRule" request + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a mute rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationMuteRule" enabled + And new "CreateSecurityFindingsAutomationMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Create a mute rule returns "Successfully created the mute rule" response + Given operation "CreateSecurityFindingsAutomationMuteRule" enabled + And new "CreateSecurityFindingsAutomationMuteRule" request + And body with value {"data": {"attributes": {"action": {"reason": "risk_accepted"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 201 Successfully created the mute rule + And the response "data.type" is equal to "mute_rules" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.enabled" is equal to true + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a mute rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationMuteRule" enabled + And new "CreateSecurityFindingsAutomationMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Create a new signal-based notification rule returns "Bad Request" response Given new "CreateSignalNotificationRule" request @@ -870,6 +924,33 @@ 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" + @generated @skip @team:DataDog/k9-automation + Scenario: Create a ticket creation rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationTicketCreationRule" enabled + And new "CreateSecurityFindingsAutomationTicketCreationRule" request + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Create a ticket creation rule returns "Successfully created the ticket creation rule" response + Given operation "CreateSecurityFindingsAutomationTicketCreationRule" enabled + And new "CreateSecurityFindingsAutomationTicketCreationRule" request + And body with value {"data": {"attributes": {"action": {"max_tickets_per_day": 10, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 201 Successfully created the ticket creation rule + And the response "data.type" is equal to "ticket_creation_rules" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.enabled" is equal to true + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a ticket creation rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationTicketCreationRule" enabled + And new "CreateSecurityFindingsAutomationTicketCreationRule" request + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Create an entity context sync configuration returns "Bad Request" response Given operation "CreateSecurityMonitoringIntegrationConfig" enabled @@ -1042,6 +1123,40 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a due date rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationDueDateRule" enabled + And new "DeleteSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Delete a due date rule returns "Rule successfully deleted." response + Given operation "DeleteSecurityFindingsAutomationDueDateRule" enabled + And there is a valid "valid_due_date_rule" in the system + And new "DeleteSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "valid_due_date_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted. + + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a mute rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationMuteRule" enabled + And new "DeleteSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Delete a mute rule returns "Rule successfully deleted." response + Given operation "DeleteSecurityFindingsAutomationMuteRule" enabled + And there is a valid "valid_mute_rule" in the system + And new "DeleteSecurityFindingsAutomationMuteRule" request + And request contains "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-siem Scenario: Delete a non existing rule returns "Not Found" response Given new "DeleteSecurityMonitoringRule" request @@ -1101,6 +1216,23 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a ticket creation rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationTicketCreationRule" enabled + And new "DeleteSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Delete a ticket creation rule returns "Rule successfully deleted." response + Given operation "DeleteSecurityFindingsAutomationTicketCreationRule" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "DeleteSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "valid_ticket_creation_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted. + @team:DataDog/cloud-security-posture-management Scenario: Delete a vulnerability-based notification rule returns "Not Found" response Given new "DeleteVulnerabilityNotificationRule" request @@ -1408,6 +1540,25 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Get a due date rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationDueDateRule" enabled + And new "GetSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Get a due date rule returns "Successfully retrieved the due date rule" response + Given operation "GetSecurityFindingsAutomationDueDateRule" enabled + And there is a valid "valid_due_date_rule" in the system + And new "GetSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "valid_due_date_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the due date rule + And the response "data.id" is equal to "{{ valid_due_date_rule.data.id }}" + And the response "data.type" is equal to "due_date_rules" + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get a finding returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetFinding" enabled @@ -1529,6 +1680,25 @@ Feature: Security Monitoring Then the response status is 200 OK And the response has 3 items + @generated @skip @team:DataDog/k9-automation + Scenario: Get a mute rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationMuteRule" enabled + And new "GetSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Get a mute rule returns "Successfully retrieved the mute rule" response + Given operation "GetSecurityFindingsAutomationMuteRule" enabled + And there is a valid "valid_mute_rule" in the system + And new "GetSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the mute rule + And the response "data.id" is equal to "{{ valid_mute_rule.data.id }}" + And the response "data.type" is equal to "mute_rules" + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get a quick list of security signals returns "Bad Request" response Given new "ListSecurityMonitoringSignals" request @@ -1680,12 +1850,49 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Get a ticket creation rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationTicketCreationRule" enabled + And new "GetSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Get a ticket creation rule returns "Successfully retrieved the ticket creation rule" response + Given operation "GetSecurityFindingsAutomationTicketCreationRule" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "GetSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "valid_ticket_creation_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the ticket creation rule + And the response "data.id" is equal to "{{ valid_ticket_creation_rule.data.id }}" + And the response "data.type" is equal to "ticket_creation_rules" + @team:DataDog/k9-cloud-siem Scenario: Get all critical assets returns "OK" response Given new "ListSecurityMonitoringCriticalAssets" request When the request is sent Then the response status is 200 OK + @team:DataDog/k9-automation + Scenario: Get all due date rules returns "Successfully retrieved the list of due date rules" response + Given operation "ListSecurityFindingsAutomationDueDateRules" enabled + And there is a valid "valid_due_date_rule" in the system + And new "ListSecurityFindingsAutomationDueDateRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of due date rules + And the response "data" has item with field "id" with value "{{ valid_due_date_rule.data.id }}" + + @team:DataDog/k9-automation + Scenario: Get all mute rules returns "Successfully retrieved the list of mute rules" response + Given operation "ListSecurityFindingsAutomationMuteRules" enabled + And there is a valid "valid_mute_rule" in the system + And new "ListSecurityFindingsAutomationMuteRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of mute rules + And the response "data" has item with field "id" with value "{{ valid_mute_rule.data.id }}" + @team:DataDog/k9-cloud-siem Scenario: Get all security filters returns "OK" response Given new "ListSecurityFilters" request @@ -1734,6 +1941,15 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "suppression2 {{ unique_hash }}" + @team:DataDog/k9-automation + Scenario: Get all ticket creation rules returns "Successfully retrieved the list of ticket creation rules" response + Given operation "ListSecurityFindingsAutomationTicketCreationRules" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "ListSecurityFindingsAutomationTicketCreationRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of ticket creation rules + And the response "data" has item with field "id" with value "{{ valid_ticket_creation_rule.data.id }}" + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get an entity context sync configuration returns "Not Found" response Given operation "GetSecurityMonitoringIntegrationConfig" enabled @@ -2517,6 +2733,81 @@ 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. + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder due date rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled + And new "ReorderSecurityFindingsAutomationDueDateRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "due_date_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Reorder due date rules returns "Successfully reordered the due date rules" response + Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled + And there is a valid "valid_due_date_rule" in the system + And new "ReorderSecurityFindingsAutomationDueDateRules" request + And body with value {"data": [{"id": "{{ valid_due_date_rule.data.id }}", "type": "due_date_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the due date rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder due date rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled + And new "ReorderSecurityFindingsAutomationDueDateRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "due_date_rules"}]} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder mute rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationMuteRules" enabled + And new "ReorderSecurityFindingsAutomationMuteRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Reorder mute rules returns "Successfully reordered the mute rules" response + Given operation "ReorderSecurityFindingsAutomationMuteRules" enabled + And there is a valid "valid_mute_rule" in the system + And new "ReorderSecurityFindingsAutomationMuteRules" request + And body with value {"data": [{"id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the mute rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder mute rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationMuteRules" enabled + And new "ReorderSecurityFindingsAutomationMuteRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder ticket creation rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationTicketCreationRules" enabled + And new "ReorderSecurityFindingsAutomationTicketCreationRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "ticket_creation_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Reorder ticket creation rules returns "Successfully reordered the ticket creation rules" response + Given operation "ReorderSecurityFindingsAutomationTicketCreationRules" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "ReorderSecurityFindingsAutomationTicketCreationRules" request + And body with value {"data": [{"id": "{{ valid_ticket_creation_rule.data.id }}", "type": "ticket_creation_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the ticket creation rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder ticket creation rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationTicketCreationRules" enabled + And new "ReorderSecurityFindingsAutomationTicketCreationRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "ticket_creation_rules"}]} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Restore a rule to a historical version returns "Bad Request" response Given operation "RestoreSecurityMonitoringRule" enabled @@ -2862,6 +3153,84 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Successfully updated the due date rule" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And there is a valid "valid_due_date_rule" in the system + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "valid_due_date_rule.data.id" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 14, "severity": "critical"}], "due_from": "first_seen"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the due date rule + And the response "data.id" is equal to "{{ valid_due_date_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Successfully updated the mute rule" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And there is a valid "valid_mute_rule" in the system + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason": "false_positive"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the mute rule + And the response "data.id" is equal to "{{ valid_mute_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Update a security filter returns "Bad Request" response Given new "UpdateSecurityFilter" request @@ -2934,6 +3303,45 @@ Feature: Security Monitoring And the response "data.attributes.suppression_query" is equal to "env:staging status:low" And the response "data.attributes.version" is equal to 2 + @generated @skip @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Successfully updated the ticket creation rule" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "valid_ticket_creation_rule.data.id" + And body with value {"data": {"attributes": {"action": {"max_tickets_per_day": 5, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the ticket creation rule + And the response "data.id" is equal to "{{ valid_ticket_creation_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Update an entity context sync configuration returns "Bad Request" response Given operation "UpdateSecurityMonitoringIntegrationConfig" enabled diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 049cc125221..896b23d3d81 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 @@ -6913,6 +6913,135 @@ "type": "idempotent" } }, + "ListSecurityFindingsAutomationDueDateRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationDueDateRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationDueDateRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "ListSecurityFindingsAutomationMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationMuteRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "ListSecurityFindingsAutomationTicketCreationRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationTicketCreationRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationTicketCreationRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "DetachCase": { "tag": "Security Monitoring", "undo": {