diff --git a/.apigentools-info b/.apigentools-info
index 0f4c0b307..8813f549a 100644
--- a/.apigentools-info
+++ b/.apigentools-info
@@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
- "regenerated": "2025-01-28 14:57:27.977823",
- "spec_repo_commit": "f832f43e"
+ "regenerated": "2025-01-28 16:23:28.013868",
+ "spec_repo_commit": "590dadb7"
},
"v2": {
"apigentools_version": "1.6.6",
- "regenerated": "2025-01-28 14:57:27.993052",
- "spec_repo_commit": "f832f43e"
+ "regenerated": "2025-01-28 16:23:28.029051",
+ "spec_repo_commit": "590dadb7"
}
}
}
\ No newline at end of file
diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index ec0661fe2..28344b419 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -733,6 +733,13 @@ components:
type: string
requestBodies: {}
responses:
+ AutomationRuleUnprocessableEntityResponse:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/JSONAPIErrorResponse'
+ description: The server cannot process the request because it contains invalid
+ data.
BadRequestResponse:
content:
application/json:
@@ -782,6 +789,28 @@ components:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden
+ InboxRulesList:
+ content:
+ application/json:
+ schema:
+ properties:
+ data:
+ items:
+ $ref: '#/components/schemas/InboxRule'
+ type: array
+ type: object
+ description: The list of inbox rules
+ MuteRulesList:
+ content:
+ application/json:
+ schema:
+ properties:
+ data:
+ items:
+ $ref: '#/components/schemas/MuteRule'
+ type: array
+ type: object
+ description: The list of mute rules
NotAuthorizedResponse:
content:
application/json:
@@ -1748,6 +1777,31 @@ components:
oneOf:
- $ref: '#/components/schemas/AWSIntegrationUpdate'
- $ref: '#/components/schemas/HTTPIntegrationUpdate'
+ ActionInbox:
+ description: Action of the inbox rule
+ properties:
+ reason_description:
+ description: Free text to add a reason description.
+ example: We want to focus on these items.
+ type: string
+ type: object
+ ActionMute:
+ description: Action of the mute rule
+ properties:
+ expire_at:
+ description: End date of the mute rule (null means mute forever)
+ example: 1893452400000
+ format: int64
+ type: integer
+ reason:
+ $ref: '#/components/schemas/MuteReason'
+ reason_description:
+ description: Free text to add a reason description.
+ example: Muting for a while
+ type: string
+ required:
+ - reason
+ type: object
ActiveBillingDimensionsAttributes:
description: List of active billing dimensions.
properties:
@@ -2757,6 +2811,49 @@ components:
type: string
x-enum-varnames:
- AUTHN_MAPPINGS
+ AutomationRule:
+ description: 'The definition of an automation pipeline rule scope.
+
+ A rule can act on specific issue types, security rule types, security rule
+ IDs, rule severities, or a query.
+
+ The query can be used to filter resources on tags and attributes.
+
+ The issue type and rule types fields are required.'
+ properties:
+ issue_type:
+ $ref: '#/components/schemas/IssueType'
+ query:
+ $ref: '#/components/schemas/RuleQuery'
+ rule_ids:
+ $ref: '#/components/schemas/RuleIds'
+ rule_types:
+ $ref: '#/components/schemas/SecurityRuleTypes'
+ severities:
+ description: The security rules severities to consider
+ items:
+ $ref: '#/components/schemas/SecurityRuleSeverity'
+ type: array
+ required:
+ - issue_type
+ - rule_types
+ type: object
+ AutomationRuleName:
+ description: Name of the pipeline rule
+ example: Rule 1
+ type: string
+ AutomationRuleUser:
+ description: User creating or modifying a rule
+ properties:
+ handle:
+ description: The user handle.
+ example: john.doe@domain.com
+ type: string
+ name:
+ description: The user name.
+ example: John Doe
+ type: string
+ type: object
AwsCURConfig:
description: AWS CUR config.
properties:
@@ -7451,6 +7548,76 @@ components:
meta:
$ref: '#/components/schemas/DataDeletionResponseMeta'
type: object
+ CreateInboxRuleParameters:
+ description: Body of the inbox rule create request
+ properties:
+ data:
+ $ref: '#/components/schemas/CreateInboxRuleParametersData'
+ type: object
+ CreateInboxRuleParametersData:
+ description: 'Data of the inbox rule create request: the rule type and the rule
+ attributes. All fields are required.'
+ properties:
+ attributes:
+ $ref: '#/components/schemas/CreateInboxRuleParametersDataAttributes'
+ type:
+ $ref: '#/components/schemas/InboxRulesType'
+ required:
+ - attributes
+ - type
+ type: object
+ CreateInboxRuleParametersDataAttributes:
+ description: 'Attributes of the inbox rule create request: the rule name, the
+ rule details, the associated action, and the optional enabled field.'
+ properties:
+ action:
+ $ref: '#/components/schemas/ActionInbox'
+ enabled:
+ $ref: '#/components/schemas/RuleEnabled'
+ name:
+ $ref: '#/components/schemas/AutomationRuleName'
+ rule:
+ $ref: '#/components/schemas/AutomationRule'
+ required:
+ - action
+ - name
+ - rule
+ type: object
+ CreateMuteRuleParameters:
+ description: Body of the mute rule create request
+ properties:
+ data:
+ $ref: '#/components/schemas/CreateMuteRuleParametersData'
+ type: object
+ CreateMuteRuleParametersData:
+ description: 'Data of the mute rule create request: the rule type and the rule
+ attributes. All fields are required.'
+ properties:
+ attributes:
+ $ref: '#/components/schemas/CreateMuteRuleParametersDataAttributes'
+ type:
+ $ref: '#/components/schemas/MuteRulesType'
+ required:
+ - attributes
+ - type
+ type: object
+ CreateMuteRuleParametersDataAttributes:
+ description: 'Attributes of the mute rule create request: the rule name, the
+ rule details, the associated action, and the optional enabled field.'
+ properties:
+ action:
+ $ref: '#/components/schemas/ActionMute'
+ enabled:
+ $ref: '#/components/schemas/RuleEnabled'
+ name:
+ $ref: '#/components/schemas/AutomationRuleName'
+ rule:
+ $ref: '#/components/schemas/AutomationRule'
+ required:
+ - action
+ - name
+ - rule
+ type: object
CreateNotificationRuleParameters:
description: Body of the notification rule create request.
properties:
@@ -13271,6 +13438,67 @@ components:
type: string
x-mimetype: application/xml
type: object
+ InboxRule:
+ description: 'Inbox rules are used to prioritize and add relevant vulnerabilities
+ to your Security Inbox.
+
+ An inbox rule is composed of a rule UUID, a rule type, and the rule attributes.
+ All fields are required.'
+ properties:
+ attributes:
+ $ref: '#/components/schemas/InboxRuleAttributes'
+ id:
+ $ref: '#/components/schemas/UUID'
+ type:
+ $ref: '#/components/schemas/InboxRulesType'
+ required:
+ - attributes
+ - id
+ - type
+ type: object
+ InboxRuleAttributes:
+ description: Attributes of the inbox rule
+ properties:
+ action:
+ $ref: '#/components/schemas/ActionInbox'
+ created_at:
+ $ref: '#/components/schemas/RuleModificationDate'
+ created_by:
+ $ref: '#/components/schemas/AutomationRuleUser'
+ enabled:
+ $ref: '#/components/schemas/RuleEnabled'
+ modified_at:
+ $ref: '#/components/schemas/RuleModificationDate'
+ modified_by:
+ $ref: '#/components/schemas/AutomationRuleUser'
+ name:
+ $ref: '#/components/schemas/AutomationRuleName'
+ rule:
+ $ref: '#/components/schemas/AutomationRule'
+ required:
+ - action
+ - created_at
+ - created_by
+ - enabled
+ - modified_at
+ - modified_by
+ - name
+ - rule
+ type: object
+ InboxRuleResponse:
+ description: Response object which includes an inbox rule.
+ properties:
+ data:
+ $ref: '#/components/schemas/InboxRule'
+ type: object
+ InboxRulesType:
+ description: The pipeline rule type associated to inbox rules
+ enum:
+ - inbox_rules
+ example: inbox_rules
+ type: string
+ x-enum-varnames:
+ - INBOX_RULES
IncidentAttachmentAttachmentType:
description: The type of the incident attachment attributes.
enum:
@@ -15405,6 +15633,14 @@ components:
- DOWN
- WARNING
- 'OFF'
+ IssueType:
+ description: The type of issues on which the rule applies
+ enum:
+ - vulnerability
+ example: vulnerability
+ type: string
+ x-enum-varnames:
+ - VULNERABILITY
JSONAPIErrorItem:
description: API error response body
properties:
@@ -19255,6 +19491,91 @@ components:
meta:
$ref: '#/components/schemas/MonthlyCostAttributionMeta'
type: object
+ MuteReason:
+ description: Reason for muting a vulnerability
+ enum:
+ - duplicate
+ - external_solution
+ - false_positive
+ - internal_solution
+ - no_fix_available
+ - other
+ - pending_fix
+ - risk_accepted
+ example: duplicate
+ type: string
+ x-enum-varnames:
+ - DUPLICATE
+ - EXTERNAL_SOLUTION
+ - FALSE_POSITIVE
+ - INTERNAL_SOLUTION
+ - NO_FIX_AVAILABLE
+ - OTHER
+ - PENDING_FIX
+ - RISK_ACCEPTED
+ MuteRule:
+ description: 'Mute rules are used to proactively filter out known false positives
+ or accepted risks.
+
+ A mute rule is composed of a rule UUID, a rule type, and the rule attributes.
+ All fields are required.
+
+ '
+ properties:
+ attributes:
+ $ref: '#/components/schemas/MuteRuleAttributes'
+ id:
+ $ref: '#/components/schemas/UUID'
+ type:
+ $ref: '#/components/schemas/MuteRulesType'
+ required:
+ - attributes
+ - id
+ - type
+ type: object
+ MuteRuleAttributes:
+ description: Attributes of the mute rule
+ properties:
+ action:
+ $ref: '#/components/schemas/ActionMute'
+ created_at:
+ $ref: '#/components/schemas/RuleModificationDate'
+ created_by:
+ $ref: '#/components/schemas/AutomationRuleUser'
+ enabled:
+ $ref: '#/components/schemas/RuleEnabled'
+ modified_at:
+ $ref: '#/components/schemas/RuleModificationDate'
+ modified_by:
+ $ref: '#/components/schemas/AutomationRuleUser'
+ name:
+ $ref: '#/components/schemas/AutomationRuleName'
+ rule:
+ $ref: '#/components/schemas/AutomationRule'
+ required:
+ - action
+ - created_at
+ - created_by
+ - enabled
+ - modified_at
+ - modified_by
+ - name
+ - rule
+ type: object
+ MuteRuleResponse:
+ description: Response object which includes a mute rule.
+ properties:
+ data:
+ $ref: '#/components/schemas/MuteRule'
+ type: object
+ MuteRulesType:
+ description: The pipeline rule type associated to mute rules
+ enum:
+ - mute_rules
+ example: mute_rules
+ type: string
+ x-enum-varnames:
+ - MUTE_RULES
NotificationRule:
description: 'Notification rules allow full control over notifications generated
by the various Datadog security products.
@@ -20186,6 +20507,74 @@ components:
$ref: '#/components/schemas/ApplicationKeyResponseIncludedItem'
type: array
type: object
+ PatchInboxRulesParameters:
+ description: Body of the inbox rule patch request
+ properties:
+ data:
+ $ref: '#/components/schemas/PatchInboxRulesParametersData'
+ type: object
+ PatchInboxRulesParametersData:
+ description: 'Data of the inbox rule patch request: the rule UUID, the rule
+ type, and the rule attributes. All fields are required.'
+ properties:
+ attributes:
+ $ref: '#/components/schemas/PatchInboxRulesParametersDataAttributes'
+ id:
+ $ref: '#/components/schemas/UUID'
+ type:
+ $ref: '#/components/schemas/InboxRulesType'
+ required:
+ - attributes
+ - id
+ - type
+ type: object
+ PatchInboxRulesParametersDataAttributes:
+ description: 'Attributes of the inbox rule patch request: the rule name, the
+ rule details, the associated action, and the enabled field.'
+ properties:
+ action:
+ $ref: '#/components/schemas/ActionInbox'
+ enabled:
+ $ref: '#/components/schemas/RuleEnabled'
+ name:
+ $ref: '#/components/schemas/AutomationRuleName'
+ rule:
+ $ref: '#/components/schemas/AutomationRule'
+ type: object
+ PatchMuteRuleParameters:
+ description: Body of the mute rule patch request
+ properties:
+ data:
+ $ref: '#/components/schemas/PatchMuteRuleParametersData'
+ type: object
+ PatchMuteRuleParametersData:
+ description: 'Data of the mute rule patch request: the rule UUID, the rule type,
+ and the rule attributes. All fields are required.'
+ properties:
+ attributes:
+ $ref: '#/components/schemas/PatchMuteRuleParametersDataAttributes'
+ id:
+ $ref: '#/components/schemas/UUID'
+ type:
+ $ref: '#/components/schemas/MuteRulesType'
+ required:
+ - attributes
+ - id
+ - type
+ type: object
+ PatchMuteRuleParametersDataAttributes:
+ description: 'Attributes of the mute rule patch request: the rule name, the
+ rule details, the associated action, and the enabled field.'
+ properties:
+ action:
+ $ref: '#/components/schemas/ActionMute'
+ enabled:
+ $ref: '#/components/schemas/RuleEnabled'
+ name:
+ $ref: '#/components/schemas/AutomationRuleName'
+ rule:
+ $ref: '#/components/schemas/AutomationRule'
+ type: object
PatchNotificationRuleParameters:
description: Body of the notification rule patch request.
properties:
@@ -22227,6 +22616,50 @@ components:
- new_advisories
- avoided_advisories
type: object
+ ReorderInboxRulesParameters:
+ description: 'Body of the inbox rule reorder request: the full list of inbox
+ rules, which must be provided in the new order.'
+ properties:
+ data:
+ description: The `ReorderInboxRulesParameters` `data`.
+ items:
+ $ref: '#/components/schemas/ReorderInboxRulesParametersData'
+ type: array
+ type: object
+ ReorderInboxRulesParametersData:
+ description: 'Data of the inbox rule reorder request: the rule UUID, the rule
+ type, and the rule attributes. All fields are required.'
+ properties:
+ id:
+ $ref: '#/components/schemas/UUID'
+ type:
+ $ref: '#/components/schemas/InboxRulesType'
+ required:
+ - id
+ - type
+ type: object
+ ReorderMuteRulesParameters:
+ description: 'Body of the mute rule reorder request: the full list of mute rules,
+ which must be provided in the new order.'
+ properties:
+ data:
+ description: The `ReorderMuteRulesParameters` `data`.
+ items:
+ $ref: '#/components/schemas/ReorderMuteRulesParametersData'
+ type: array
+ type: object
+ ReorderMuteRulesParametersData:
+ description: 'Data of the mute rule reorder request: a rule UUID and its type.
+ All fields are required.'
+ properties:
+ id:
+ $ref: '#/components/schemas/UUID'
+ type:
+ $ref: '#/components/schemas/MuteRulesType'
+ required:
+ - id
+ - type
+ type: object
ReorderRetentionFiltersRequest:
description: A list of retention filters to reorder.
properties:
@@ -22911,10 +23344,26 @@ components:
example: Deployments automated via Deployment Trains
type: string
type: object
+ RuleEnabled:
+ description: Field used to enable or disable the rule.
+ example: true
+ type: boolean
RuleId:
description: The unique ID for a scorecard rule.
example: q8MQxk8TCqrHnWkx
type: string
+ RuleIds:
+ description: Security rule ids
+ items:
+ description: Id of a rule
+ example: rule-id-1
+ type: string
+ type: array
+ RuleModificationDate:
+ description: Date as Unix timestamp in milliseconds
+ example: 1722439510282
+ format: int64
+ type: integer
RuleName:
description: Name of the notification rule.
example: Rule 1
@@ -22925,6 +23374,11 @@ components:
rule:
$ref: '#/components/schemas/RelationshipToOutcome'
type: object
+ RuleQuery:
+ description: The query is composed of one or several key:value pairs, which
+ can be used to filter resources on tags and attributes.
+ example: key:val
+ type: string
RuleSeverity:
description: Severity of a security rule.
enum:
@@ -25894,6 +26348,52 @@ components:
nullable: true
type: string
type: object
+ SecurityRuleSeverity:
+ description: Severity of a security rule
+ enum:
+ - critical
+ - high
+ - medium
+ - low
+ - unknown
+ - info
+ example: critical
+ type: string
+ x-enum-varnames:
+ - CRITICAL
+ - HIGH
+ - MEDIUM
+ - LOW
+ - UNKNOWN
+ - INFO
+ SecurityRuleTypes:
+ description: Security rule types
+ example:
+ - application_code_vulnerability
+ items:
+ $ref: '#/components/schemas/SecurityRuleTypesItems'
+ type: array
+ SecurityRuleTypesItems:
+ description: Security rule type
+ enum:
+ - application_code_vulnerability
+ - application_library_vulnerability
+ - attack_path
+ - container_image_vulnerability
+ - host_vulnerability
+ - identity_risk
+ - misconfiguration
+ - api_security
+ type: string
+ x-enum-varnames:
+ - APPLICATION_CODE_VULNERABILITY
+ - APPLICATION_LIBRARY_VULNERABILITY
+ - ATTACK_PATH
+ - CONTAINER_IMAGE_VULNERABILITY
+ - HOST_VULNERABILITY
+ - IDENTITY_RISK
+ - MISCONFIGURATION
+ - API_SECURITY
Selectors:
description: 'Selectors are used to filter security issues for which notifications
should be generated.
@@ -29421,6 +29921,11 @@ components:
x-enum-varnames:
- SECURITY_FINDINGS
- SECURITY_SIGNALS
+ UUID:
+ description: The ID of a pipeline rule
+ example: 123e4567-e89b-12d3-a456-426655440000
+ format: uuid
+ type: string
Unit:
description: Object containing the metric unit family, scale factor, name, and
short name.
@@ -29641,6 +30146,48 @@ components:
type: string
type: array
type: object
+ UpdateInboxRuleParameters:
+ description: Body of the inbox rule update request
+ properties:
+ data:
+ $ref: '#/components/schemas/UpdateInboxRuleParametersData'
+ type: object
+ UpdateInboxRuleParametersData:
+ description: 'Data of the inbox rule update request: the rule id, the rule type,
+ and the rule attributes. All fields are required.'
+ properties:
+ attributes:
+ $ref: '#/components/schemas/CreateInboxRuleParametersDataAttributes'
+ id:
+ $ref: '#/components/schemas/UUID'
+ type:
+ $ref: '#/components/schemas/InboxRulesType'
+ required:
+ - id
+ - attributes
+ - type
+ type: object
+ UpdateMuteRuleParameters:
+ description: Body of the mute rule update request
+ properties:
+ data:
+ $ref: '#/components/schemas/UpdateMuteRuleParametersData'
+ type: object
+ UpdateMuteRuleParametersData:
+ description: 'Data of the mute rule update request: the rule id, the rule type,
+ and the rule attributes. All fields are required.'
+ properties:
+ attributes:
+ $ref: '#/components/schemas/CreateMuteRuleParametersDataAttributes'
+ id:
+ $ref: '#/components/schemas/UUID'
+ type:
+ $ref: '#/components/schemas/MuteRulesType'
+ required:
+ - id
+ - attributes
+ - type
+ type: object
UpdateOpenAPIResponse:
description: Response for `UpdateOpenAPI`.
properties:
@@ -44442,6 +44989,559 @@ paths:
operator: OR
permissions:
- security_monitoring_notification_profiles_write
+ /api/v2/security/vulnerabilities/pipelines/inbox_rules:
+ get:
+ description: Returns the ordered list of inbox rules in the pipeline (first
+ match applies)
+ operationId: GetInboxRules
+ responses:
+ '200':
+ $ref: '#/components/responses/InboxRulesList'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_read
+ summary: Get the ordered list of inbox rules
+ tags:
+ - Security Monitoring
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_read
+ post:
+ description: Create a new inbox rule and return the created rule.
+ operationId: CreateInboxRule
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateInboxRuleParameters'
+ description: 'Mandatory fields are the rule type and the required attributes:
+ rule name, rule details, and action.
+
+ The rule details are composed of issue types and security rule types on
+ which the rule applies. Optional security rule IDs, severities, and a tag
+ or attribute query can be provided.
+
+ The action is composed of the optional reason description.
+
+ '
+ required: true
+ responses:
+ '201':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/InboxRuleResponse'
+ description: Successfully created the inbox rule
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Create a new inbox rule
+ tags:
+ - Security Monitoring
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
+ /api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder:
+ post:
+ description: 'Reorder the list of inbox rules in the pipeline and return the
+ reordered list of rules.
+
+ To reorder fields, you must provide the full list of pipeline rules in the
+ new order.'
+ operationId: ReorderInboxRules
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ReorderInboxRulesParameters'
+ description: 'The list of rules to reorder. The order of the rules in the
+ list becomes the new order in the pipeline.
+
+ '
+ required: true
+ responses:
+ '200':
+ $ref: '#/components/responses/InboxRulesList'
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Reorder the list of inbox rules in the pipeline
+ tags:
+ - Security Monitoring
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
+ /api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}:
+ delete:
+ description: Delete an inbox rule
+ operationId: DeleteInboxRule
+ parameters:
+ - description: ID of the inbox rule
+ in: path
+ name: inbox_rule_id
+ required: true
+ schema:
+ format: uuid
+ type: string
+ responses:
+ '204':
+ description: Rule successfully deleted
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '404':
+ $ref: '#/components/responses/NotFoundResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Delete an inbox rule
+ tags:
+ - Security Monitoring
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
+ get:
+ description: Get the details of an inbox rule.
+ operationId: GetInboxRule
+ parameters:
+ - description: ID of the inbox rule
+ in: path
+ name: inbox_rule_id
+ required: true
+ schema:
+ format: uuid
+ type: string
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/InboxRuleResponse'
+ description: Inbox rule details
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '404':
+ $ref: '#/components/responses/NotFoundResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_read
+ summary: Get details of an inbox rule
+ tags:
+ - Security Monitoring
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_read
+ patch:
+ description: Partially update the inbox rule. All fields are optional; if a
+ field is not provided, it is not updated.
+ operationId: PatchInboxRule
+ parameters:
+ - description: ID of the inbox rule
+ in: path
+ name: inbox_rule_id
+ required: true
+ schema:
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PatchInboxRulesParameters'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/InboxRuleResponse'
+ description: Inbox rule successfully patched
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '404':
+ $ref: '#/components/responses/NotFoundResponse'
+ '422':
+ $ref: '#/components/responses/AutomationRuleUnprocessableEntityResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Patch an inbox rule
+ tags:
+ - Security Monitoring
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
+ put:
+ description: Update the whole inbox rule. If an optional field is not provided,
+ it is set to its default value.
+ operationId: UpdateInboxRule
+ parameters:
+ - description: ID of the inbox rule
+ in: path
+ name: inbox_rule_id
+ required: true
+ schema:
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateInboxRuleParameters'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/InboxRuleResponse'
+ description: Inbox rule successfully updated
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '404':
+ $ref: '#/components/responses/NotFoundResponse'
+ '422':
+ $ref: '#/components/responses/AutomationRuleUnprocessableEntityResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Update an inbox rule
+ tags:
+ - Security Monitoring
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
+ /api/v2/security/vulnerabilities/pipelines/mute_rules:
+ get:
+ description: Returns the ordered list of mute rules in the pipeline (first match
+ applies)
+ operationId: GetMuteRules
+ responses:
+ '200':
+ $ref: '#/components/responses/MuteRulesList'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_read
+ summary: Get the ordered list of mute rules
+ tags:
+ - Security Monitoring
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_read
+ post:
+ description: Create a new mute rule and return the created rule.
+ operationId: CreateMuteRule
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateMuteRuleParameters'
+ description: 'Mandatory fields are the rule type and the required attributes:
+ rule name, rule details, and action.
+
+ The rule details are composed of issue types and security rule types on
+ which the rule applies. Optional security rule IDs, severities, and a tag
+ or attribute query can be provided.
+
+ The action is composed of the reason for muting and the rule expiration
+ date, and optionally a description of the rule.
+
+ '
+ required: true
+ responses:
+ '201':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/MuteRuleResponse'
+ description: Successfully created the mute rule
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Create a new mute rule
+ tags:
+ - Security Monitoring
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
+ /api/v2/security/vulnerabilities/pipelines/mute_rules/reorder:
+ post:
+ description: 'Reorder the list of mute rules in the pipeline and return the
+ reordered list of rules.
+
+ To reorder fields, you must provide the full list of pipeline rules in the
+ new order.'
+ operationId: ReorderMuteRules
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ReorderMuteRulesParameters'
+ description: 'The list of rules to reorder. The order of the rules in the
+ list becomes the new order in the pipeline.
+
+ '
+ required: true
+ responses:
+ '200':
+ $ref: '#/components/responses/MuteRulesList'
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Reorder the list of mute rules in the pipeline
+ tags:
+ - Security Monitoring
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
+ /api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}:
+ delete:
+ description: Delete a mute rule
+ operationId: DeleteMuteRule
+ parameters:
+ - description: ID of the mute rule
+ in: path
+ name: mute_rule_id
+ required: true
+ schema:
+ format: uuid
+ type: string
+ responses:
+ '204':
+ description: Rule successfully deleted
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '404':
+ $ref: '#/components/responses/NotFoundResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Delete a mute rule
+ tags:
+ - Security Monitoring
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
+ get:
+ description: Get the details of a mute rule.
+ operationId: GetMuteRule
+ parameters:
+ - description: ID of the mute rule
+ in: path
+ name: mute_rule_id
+ required: true
+ schema:
+ format: uuid
+ type: string
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/MuteRuleResponse'
+ description: Mute rule details
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '404':
+ $ref: '#/components/responses/NotFoundResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_read
+ summary: Get details of a mute rule
+ tags:
+ - Security Monitoring
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_read
+ patch:
+ description: Partially update the mute rule. All fields are optional; if a field
+ is not provided, it is not updated.
+ operationId: PatchMuteRule
+ parameters:
+ - description: ID of the mute rule
+ in: path
+ name: mute_rule_id
+ required: true
+ schema:
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/PatchMuteRuleParameters'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/MuteRuleResponse'
+ description: Mute rule successfully patched
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '404':
+ $ref: '#/components/responses/NotFoundResponse'
+ '422':
+ $ref: '#/components/responses/AutomationRuleUnprocessableEntityResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Patch a mute rule
+ tags:
+ - Security Monitoring
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
+ put:
+ description: Update the whole mute rule. If an optional field is not provided,
+ it is set to its default value.
+ operationId: UpdateMuteRule
+ parameters:
+ - description: ID of the mute rule
+ in: path
+ name: mute_rule_id
+ required: true
+ schema:
+ format: uuid
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateMuteRuleParameters'
+ required: true
+ responses:
+ '200':
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/MuteRuleResponse'
+ description: Mute rule successfully updated
+ '400':
+ $ref: '#/components/responses/BadRequestResponse'
+ '403':
+ $ref: '#/components/responses/ForbiddenResponse'
+ '404':
+ $ref: '#/components/responses/NotFoundResponse'
+ '422':
+ $ref: '#/components/responses/AutomationRuleUnprocessableEntityResponse'
+ '429':
+ $ref: '#/components/responses/TooManyRequestsResponse'
+ security:
+ - apiKeyAuth: []
+ appKeyAuth: []
+ - AuthZ:
+ - security_pipelines_write
+ summary: Update a mute rule
+ tags:
+ - Security Monitoring
+ x-codegen-request-body-name: body
+ x-permission:
+ operator: OR
+ permissions:
+ - security_pipelines_write
/api/v2/security_monitoring/cloud_workload_security/agent_rules:
get:
description: Get the list of Agent rules.
diff --git a/examples/v2_security-monitoring_CreateInboxRule.rs b/examples/v2_security-monitoring_CreateInboxRule.rs
new file mode 100644
index 000000000..f1f798fa5
--- /dev/null
+++ b/examples/v2_security-monitoring_CreateInboxRule.rs
@@ -0,0 +1,39 @@
+// Create a new inbox rule returns "Successfully created the inbox rule" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+use datadog_api_client::datadogV2::model::ActionInbox;
+use datadog_api_client::datadogV2::model::AutomationRule;
+use datadog_api_client::datadogV2::model::CreateInboxRuleParameters;
+use datadog_api_client::datadogV2::model::CreateInboxRuleParametersData;
+use datadog_api_client::datadogV2::model::CreateInboxRuleParametersDataAttributes;
+use datadog_api_client::datadogV2::model::InboxRulesType;
+use datadog_api_client::datadogV2::model::IssueType;
+use datadog_api_client::datadogV2::model::SecurityRuleSeverity;
+use datadog_api_client::datadogV2::model::SecurityRuleTypesItems;
+
+#[tokio::main]
+async fn main() {
+ let body = CreateInboxRuleParameters::new().data(CreateInboxRuleParametersData::new(
+ CreateInboxRuleParametersDataAttributes::new(
+ ActionInbox::new().reason_description("We want to focus on these items.".to_string()),
+ "Rule 1".to_string(),
+ AutomationRule::new(
+ IssueType::VULNERABILITY,
+ vec![SecurityRuleTypesItems::APPLICATION_CODE_VULNERABILITY],
+ )
+ .query("key:val".to_string())
+ .rule_ids(vec!["rule-id-1".to_string()])
+ .severities(vec![SecurityRuleSeverity::CRITICAL]),
+ )
+ .enabled(true),
+ InboxRulesType::INBOX_RULES,
+ ));
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api.create_inbox_rule(body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_CreateMuteRule.rs b/examples/v2_security-monitoring_CreateMuteRule.rs
new file mode 100644
index 000000000..66d5abaef
--- /dev/null
+++ b/examples/v2_security-monitoring_CreateMuteRule.rs
@@ -0,0 +1,42 @@
+// Create a new mute rule returns "Successfully created the mute rule" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+use datadog_api_client::datadogV2::model::ActionMute;
+use datadog_api_client::datadogV2::model::AutomationRule;
+use datadog_api_client::datadogV2::model::CreateMuteRuleParameters;
+use datadog_api_client::datadogV2::model::CreateMuteRuleParametersData;
+use datadog_api_client::datadogV2::model::CreateMuteRuleParametersDataAttributes;
+use datadog_api_client::datadogV2::model::IssueType;
+use datadog_api_client::datadogV2::model::MuteReason;
+use datadog_api_client::datadogV2::model::MuteRulesType;
+use datadog_api_client::datadogV2::model::SecurityRuleSeverity;
+use datadog_api_client::datadogV2::model::SecurityRuleTypesItems;
+
+#[tokio::main]
+async fn main() {
+ let body = CreateMuteRuleParameters::new().data(CreateMuteRuleParametersData::new(
+ CreateMuteRuleParametersDataAttributes::new(
+ ActionMute::new(MuteReason::DUPLICATE)
+ .expire_at(1893452400000)
+ .reason_description("Muting for a while".to_string()),
+ "Rule 1".to_string(),
+ AutomationRule::new(
+ IssueType::VULNERABILITY,
+ vec![SecurityRuleTypesItems::APPLICATION_CODE_VULNERABILITY],
+ )
+ .query("key:val".to_string())
+ .rule_ids(vec!["rule-id-1".to_string()])
+ .severities(vec![SecurityRuleSeverity::CRITICAL]),
+ )
+ .enabled(true),
+ MuteRulesType::MUTE_RULES,
+ ));
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api.create_mute_rule(body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_DeleteInboxRule.rs b/examples/v2_security-monitoring_DeleteInboxRule.rs
new file mode 100644
index 000000000..90302023b
--- /dev/null
+++ b/examples/v2_security-monitoring_DeleteInboxRule.rs
@@ -0,0 +1,21 @@
+// Delete an inbox rule returns "Rule successfully deleted" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "valid_inbox_rule" in the system
+ let valid_inbox_rule_data_id =
+ uuid::Uuid::parse_str(&std::env::var("VALID_INBOX_RULE_DATA_ID").unwrap())
+ .expect("Invalid UUID");
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api
+ .delete_inbox_rule(valid_inbox_rule_data_id.clone())
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_DeleteMuteRule.rs b/examples/v2_security-monitoring_DeleteMuteRule.rs
new file mode 100644
index 000000000..5e62c879a
--- /dev/null
+++ b/examples/v2_security-monitoring_DeleteMuteRule.rs
@@ -0,0 +1,19 @@
+// Delete a mute rule returns "Rule successfully deleted" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "valid_mute_rule" in the system
+ let valid_mute_rule_data_id =
+ uuid::Uuid::parse_str(&std::env::var("VALID_MUTE_RULE_DATA_ID").unwrap())
+ .expect("Invalid UUID");
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api.delete_mute_rule(valid_mute_rule_data_id.clone()).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_GetInboxRule.rs b/examples/v2_security-monitoring_GetInboxRule.rs
new file mode 100644
index 000000000..1b032b783
--- /dev/null
+++ b/examples/v2_security-monitoring_GetInboxRule.rs
@@ -0,0 +1,19 @@
+// Get details of an inbox rule returns "Inbox rule details" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "valid_inbox_rule" in the system
+ let valid_inbox_rule_data_id =
+ uuid::Uuid::parse_str(&std::env::var("VALID_INBOX_RULE_DATA_ID").unwrap())
+ .expect("Invalid UUID");
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api.get_inbox_rule(valid_inbox_rule_data_id.clone()).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_GetInboxRules.rs b/examples/v2_security-monitoring_GetInboxRules.rs
new file mode 100644
index 000000000..d57a6ce4f
--- /dev/null
+++ b/examples/v2_security-monitoring_GetInboxRules.rs
@@ -0,0 +1,15 @@
+// Get the ordered list of inbox rules returns "The list of inbox rules" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+
+#[tokio::main]
+async fn main() {
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api.get_inbox_rules().await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_GetMuteRule.rs b/examples/v2_security-monitoring_GetMuteRule.rs
new file mode 100644
index 000000000..8f10620de
--- /dev/null
+++ b/examples/v2_security-monitoring_GetMuteRule.rs
@@ -0,0 +1,19 @@
+// Get details of a mute rule returns "Mute rule details" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "valid_mute_rule" in the system
+ let valid_mute_rule_data_id =
+ uuid::Uuid::parse_str(&std::env::var("VALID_MUTE_RULE_DATA_ID").unwrap())
+ .expect("Invalid UUID");
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api.get_mute_rule(valid_mute_rule_data_id.clone()).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_GetMuteRules.rs b/examples/v2_security-monitoring_GetMuteRules.rs
new file mode 100644
index 000000000..44366eb06
--- /dev/null
+++ b/examples/v2_security-monitoring_GetMuteRules.rs
@@ -0,0 +1,15 @@
+// Get the ordered list of mute rules returns "The list of mute rules" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+
+#[tokio::main]
+async fn main() {
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api.get_mute_rules().await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_PatchInboxRule.rs b/examples/v2_security-monitoring_PatchInboxRule.rs
new file mode 100644
index 000000000..66f129d0b
--- /dev/null
+++ b/examples/v2_security-monitoring_PatchInboxRule.rs
@@ -0,0 +1,50 @@
+// Patch an inbox rule returns "Inbox rule successfully patched" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+use datadog_api_client::datadogV2::model::ActionInbox;
+use datadog_api_client::datadogV2::model::AutomationRule;
+use datadog_api_client::datadogV2::model::InboxRulesType;
+use datadog_api_client::datadogV2::model::IssueType;
+use datadog_api_client::datadogV2::model::PatchInboxRulesParameters;
+use datadog_api_client::datadogV2::model::PatchInboxRulesParametersData;
+use datadog_api_client::datadogV2::model::PatchInboxRulesParametersDataAttributes;
+use datadog_api_client::datadogV2::model::SecurityRuleSeverity;
+use datadog_api_client::datadogV2::model::SecurityRuleTypesItems;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "valid_inbox_rule" in the system
+ let valid_inbox_rule_data_id =
+ uuid::Uuid::parse_str(&std::env::var("VALID_INBOX_RULE_DATA_ID").unwrap())
+ .expect("Invalid UUID");
+ let body = PatchInboxRulesParameters::new().data(PatchInboxRulesParametersData::new(
+ PatchInboxRulesParametersDataAttributes::new()
+ .action(
+ ActionInbox::new()
+ .reason_description("We want to focus on these items.".to_string()),
+ )
+ .enabled(true)
+ .name("Rule 1".to_string())
+ .rule(
+ AutomationRule::new(
+ IssueType::VULNERABILITY,
+ vec![SecurityRuleTypesItems::APPLICATION_CODE_VULNERABILITY],
+ )
+ .query("key:val".to_string())
+ .rule_ids(vec!["rule-id-1".to_string()])
+ .severities(vec![SecurityRuleSeverity::CRITICAL]),
+ ),
+ valid_inbox_rule_data_id.clone(),
+ InboxRulesType::INBOX_RULES,
+ ));
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api
+ .patch_inbox_rule(valid_inbox_rule_data_id.clone(), body)
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_PatchMuteRule.rs b/examples/v2_security-monitoring_PatchMuteRule.rs
new file mode 100644
index 000000000..ffe62c6b4
--- /dev/null
+++ b/examples/v2_security-monitoring_PatchMuteRule.rs
@@ -0,0 +1,52 @@
+// Patch a mute rule returns "Mute rule successfully patched" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+use datadog_api_client::datadogV2::model::ActionMute;
+use datadog_api_client::datadogV2::model::AutomationRule;
+use datadog_api_client::datadogV2::model::IssueType;
+use datadog_api_client::datadogV2::model::MuteReason;
+use datadog_api_client::datadogV2::model::MuteRulesType;
+use datadog_api_client::datadogV2::model::PatchMuteRuleParameters;
+use datadog_api_client::datadogV2::model::PatchMuteRuleParametersData;
+use datadog_api_client::datadogV2::model::PatchMuteRuleParametersDataAttributes;
+use datadog_api_client::datadogV2::model::SecurityRuleSeverity;
+use datadog_api_client::datadogV2::model::SecurityRuleTypesItems;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "valid_mute_rule" in the system
+ let valid_mute_rule_data_id =
+ uuid::Uuid::parse_str(&std::env::var("VALID_MUTE_RULE_DATA_ID").unwrap())
+ .expect("Invalid UUID");
+ let body = PatchMuteRuleParameters::new().data(PatchMuteRuleParametersData::new(
+ PatchMuteRuleParametersDataAttributes::new()
+ .action(
+ ActionMute::new(MuteReason::DUPLICATE)
+ .expire_at(1893452400000)
+ .reason_description("Muting for a while".to_string()),
+ )
+ .enabled(true)
+ .name("Rule 1".to_string())
+ .rule(
+ AutomationRule::new(
+ IssueType::VULNERABILITY,
+ vec![SecurityRuleTypesItems::APPLICATION_CODE_VULNERABILITY],
+ )
+ .query("key:val".to_string())
+ .rule_ids(vec!["rule-id-1".to_string()])
+ .severities(vec![SecurityRuleSeverity::CRITICAL]),
+ ),
+ valid_mute_rule_data_id.clone(),
+ MuteRulesType::MUTE_RULES,
+ ));
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api
+ .patch_mute_rule(valid_mute_rule_data_id.clone(), body)
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_ReorderInboxRules.rs b/examples/v2_security-monitoring_ReorderInboxRules.rs
new file mode 100644
index 000000000..de037288a
--- /dev/null
+++ b/examples/v2_security-monitoring_ReorderInboxRules.rs
@@ -0,0 +1,24 @@
+// Reorder the list of inbox rules in the pipeline returns "The list of inbox
+// rules" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+use datadog_api_client::datadogV2::model::InboxRulesType;
+use datadog_api_client::datadogV2::model::ReorderInboxRulesParameters;
+use datadog_api_client::datadogV2::model::ReorderInboxRulesParametersData;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let body = ReorderInboxRulesParameters::new().data(vec![ReorderInboxRulesParametersData::new(
+ Uuid::parse_str("123e4567-e89b-12d3-a456-426655440000").expect("invalid UUID"),
+ InboxRulesType::INBOX_RULES,
+ )]);
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api.reorder_inbox_rules(body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_ReorderMuteRules.rs b/examples/v2_security-monitoring_ReorderMuteRules.rs
new file mode 100644
index 000000000..cab93464d
--- /dev/null
+++ b/examples/v2_security-monitoring_ReorderMuteRules.rs
@@ -0,0 +1,24 @@
+// Reorder the list of mute rules in the pipeline returns "The list of mute rules"
+// response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+use datadog_api_client::datadogV2::model::MuteRulesType;
+use datadog_api_client::datadogV2::model::ReorderMuteRulesParameters;
+use datadog_api_client::datadogV2::model::ReorderMuteRulesParametersData;
+use uuid::Uuid;
+
+#[tokio::main]
+async fn main() {
+ let body = ReorderMuteRulesParameters::new().data(vec![ReorderMuteRulesParametersData::new(
+ Uuid::parse_str("123e4567-e89b-12d3-a456-426655440000").expect("invalid UUID"),
+ MuteRulesType::MUTE_RULES,
+ )]);
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api.reorder_mute_rules(body).await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_UpdateInboxRule.rs b/examples/v2_security-monitoring_UpdateInboxRule.rs
new file mode 100644
index 000000000..0726296e7
--- /dev/null
+++ b/examples/v2_security-monitoring_UpdateInboxRule.rs
@@ -0,0 +1,46 @@
+// Update an inbox rule returns "Inbox rule successfully updated" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+use datadog_api_client::datadogV2::model::ActionInbox;
+use datadog_api_client::datadogV2::model::AutomationRule;
+use datadog_api_client::datadogV2::model::CreateInboxRuleParametersDataAttributes;
+use datadog_api_client::datadogV2::model::InboxRulesType;
+use datadog_api_client::datadogV2::model::IssueType;
+use datadog_api_client::datadogV2::model::SecurityRuleSeverity;
+use datadog_api_client::datadogV2::model::SecurityRuleTypesItems;
+use datadog_api_client::datadogV2::model::UpdateInboxRuleParameters;
+use datadog_api_client::datadogV2::model::UpdateInboxRuleParametersData;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "valid_inbox_rule" in the system
+ let valid_inbox_rule_data_id =
+ uuid::Uuid::parse_str(&std::env::var("VALID_INBOX_RULE_DATA_ID").unwrap())
+ .expect("Invalid UUID");
+ let body = UpdateInboxRuleParameters::new().data(UpdateInboxRuleParametersData::new(
+ CreateInboxRuleParametersDataAttributes::new(
+ ActionInbox::new().reason_description("We want to focus on these items.".to_string()),
+ "Rule 1".to_string(),
+ AutomationRule::new(
+ IssueType::VULNERABILITY,
+ vec![SecurityRuleTypesItems::APPLICATION_CODE_VULNERABILITY],
+ )
+ .query("key:val".to_string())
+ .rule_ids(vec!["rule-id-1".to_string()])
+ .severities(vec![SecurityRuleSeverity::CRITICAL]),
+ )
+ .enabled(true),
+ valid_inbox_rule_data_id.clone(),
+ InboxRulesType::INBOX_RULES,
+ ));
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api
+ .update_inbox_rule(valid_inbox_rule_data_id.clone(), body)
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/examples/v2_security-monitoring_UpdateMuteRule.rs b/examples/v2_security-monitoring_UpdateMuteRule.rs
new file mode 100644
index 000000000..880985acc
--- /dev/null
+++ b/examples/v2_security-monitoring_UpdateMuteRule.rs
@@ -0,0 +1,49 @@
+// Update a mute rule returns "Mute rule successfully updated" response
+use datadog_api_client::datadog;
+use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI;
+use datadog_api_client::datadogV2::model::ActionMute;
+use datadog_api_client::datadogV2::model::AutomationRule;
+use datadog_api_client::datadogV2::model::CreateMuteRuleParametersDataAttributes;
+use datadog_api_client::datadogV2::model::IssueType;
+use datadog_api_client::datadogV2::model::MuteReason;
+use datadog_api_client::datadogV2::model::MuteRulesType;
+use datadog_api_client::datadogV2::model::SecurityRuleSeverity;
+use datadog_api_client::datadogV2::model::SecurityRuleTypesItems;
+use datadog_api_client::datadogV2::model::UpdateMuteRuleParameters;
+use datadog_api_client::datadogV2::model::UpdateMuteRuleParametersData;
+
+#[tokio::main]
+async fn main() {
+ // there is a valid "valid_mute_rule" in the system
+ let valid_mute_rule_data_id =
+ uuid::Uuid::parse_str(&std::env::var("VALID_MUTE_RULE_DATA_ID").unwrap())
+ .expect("Invalid UUID");
+ let body = UpdateMuteRuleParameters::new().data(UpdateMuteRuleParametersData::new(
+ CreateMuteRuleParametersDataAttributes::new(
+ ActionMute::new(MuteReason::DUPLICATE)
+ .expire_at(1893452400000)
+ .reason_description("Muting for a while".to_string()),
+ "Rule 1".to_string(),
+ AutomationRule::new(
+ IssueType::VULNERABILITY,
+ vec![SecurityRuleTypesItems::APPLICATION_CODE_VULNERABILITY],
+ )
+ .query("key:val".to_string())
+ .rule_ids(vec!["rule-id-1".to_string()])
+ .severities(vec![SecurityRuleSeverity::CRITICAL]),
+ )
+ .enabled(true),
+ valid_mute_rule_data_id.clone(),
+ MuteRulesType::MUTE_RULES,
+ ));
+ let configuration = datadog::Configuration::new();
+ let api = SecurityMonitoringAPI::with_config(configuration);
+ let resp = api
+ .update_mute_rule(valid_mute_rule_data_id.clone(), body)
+ .await;
+ if let Ok(value) = resp {
+ println!("{:#?}", value);
+ } else {
+ println!("{:#?}", resp.unwrap_err());
+ }
+}
diff --git a/src/datadogV2/api/api_security_monitoring.rs b/src/datadogV2/api/api_security_monitoring.rs
index 8549fe979..20e21a88a 100644
--- a/src/datadogV2/api/api_security_monitoring.rs
+++ b/src/datadogV2/api/api_security_monitoring.rs
@@ -730,6 +730,22 @@ pub enum ConvertSecurityMonitoringRuleFromJSONToTerraformError {
UnknownValue(serde_json::Value),
}
+/// CreateInboxRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::create_inbox_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum CreateInboxRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// CreateMuteRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::create_mute_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum CreateMuteRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
/// CreateSecurityFilterError is a struct for typed errors of method [`SecurityMonitoringAPI::create_security_filter`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -778,6 +794,22 @@ pub enum DeleteHistoricalJobError {
UnknownValue(serde_json::Value),
}
+/// DeleteInboxRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::delete_inbox_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum DeleteInboxRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// DeleteMuteRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::delete_mute_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum DeleteMuteRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
/// DeleteSecurityFilterError is a struct for typed errors of method [`SecurityMonitoringAPI::delete_security_filter`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -858,6 +890,38 @@ pub enum GetHistoricalJobError {
UnknownValue(serde_json::Value),
}
+/// GetInboxRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::get_inbox_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum GetInboxRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// GetInboxRulesError is a struct for typed errors of method [`SecurityMonitoringAPI::get_inbox_rules`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum GetInboxRulesError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// GetMuteRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::get_mute_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum GetMuteRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// GetMuteRulesError is a struct for typed errors of method [`SecurityMonitoringAPI::get_mute_rules`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum GetMuteRulesError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
/// GetSBOMError is a struct for typed errors of method [`SecurityMonitoringAPI::get_sbom`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -1005,6 +1069,24 @@ pub enum MuteFindingsError {
UnknownValue(serde_json::Value),
}
+/// PatchInboxRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::patch_inbox_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum PatchInboxRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// PatchMuteRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::patch_mute_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum PatchMuteRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
/// PatchSignalNotificationRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::patch_signal_notification_rule`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -1023,6 +1105,22 @@ pub enum PatchVulnerabilityNotificationRuleError {
UnknownValue(serde_json::Value),
}
+/// ReorderInboxRulesError is a struct for typed errors of method [`SecurityMonitoringAPI::reorder_inbox_rules`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum ReorderInboxRulesError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// ReorderMuteRulesError is a struct for typed errors of method [`SecurityMonitoringAPI::reorder_mute_rules`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum ReorderMuteRulesError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
/// RunHistoricalJobError is a struct for typed errors of method [`SecurityMonitoringAPI::run_historical_job`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -1055,6 +1153,24 @@ pub enum TestSecurityMonitoringRuleError {
UnknownValue(serde_json::Value),
}
+/// UpdateInboxRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::update_inbox_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum UpdateInboxRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
+/// UpdateMuteRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::update_mute_rule`]
+#[derive(Debug, Clone, Serialize, Deserialize)]
+#[serde(untagged)]
+pub enum UpdateMuteRuleError {
+ APIErrorResponse(crate::datadogV2::model::APIErrorResponse),
+ JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse),
+ UnknownValue(serde_json::Value),
+}
+
/// UpdateSecurityFilterError is a struct for typed errors of method [`SecurityMonitoringAPI::update_security_filter`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
@@ -1664,18 +1780,13 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a security filter.
- ///
- /// See the [security filter guide]()
- /// for more examples.
- pub async fn create_security_filter(
+ /// Create a new inbox rule and return the created rule.
+ pub async fn create_inbox_rule(
&self,
- body: crate::datadogV2::model::SecurityFilterCreateRequest,
- ) -> Result<
- crate::datadogV2::model::SecurityFilterResponse,
- datadog::Error,
- > {
- match self.create_security_filter_with_http_info(body).await {
+ body: crate::datadogV2::model::CreateInboxRuleParameters,
+ ) -> Result>
+ {
+ match self.create_inbox_rule_with_http_info(body).await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -1689,24 +1800,21 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a security filter.
- ///
- /// See the [security filter guide]()
- /// for more examples.
- pub async fn create_security_filter_with_http_info(
+ /// Create a new inbox rule and return the created rule.
+ pub async fn create_inbox_rule_with_http_info(
&self,
- body: crate::datadogV2::model::SecurityFilterCreateRequest,
+ body: crate::datadogV2::model::CreateInboxRuleParameters,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.create_security_filter";
+ let operation_id = "v2.create_inbox_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/configuration/security_filters",
+ "{}/api/v2/security/vulnerabilities/pipelines/inbox_rules",
local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
@@ -1800,9 +1908,8 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
- &local_content,
- ) {
+ match serde_json::from_str::(&local_content)
+ {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -1813,7 +1920,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -1824,18 +1931,13 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a detection rule.
- pub async fn create_security_monitoring_rule(
+ /// Create a new mute rule and return the created rule.
+ pub async fn create_mute_rule(
&self,
- body: crate::datadogV2::model::SecurityMonitoringRuleCreatePayload,
- ) -> Result<
- crate::datadogV2::model::SecurityMonitoringRuleResponse,
- datadog::Error,
- > {
- match self
- .create_security_monitoring_rule_with_http_info(body)
- .await
- {
+ body: crate::datadogV2::model::CreateMuteRuleParameters,
+ ) -> Result>
+ {
+ match self.create_mute_rule_with_http_info(body).await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -1849,21 +1951,21 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a detection rule.
- pub async fn create_security_monitoring_rule_with_http_info(
+ /// Create a new mute rule and return the created rule.
+ pub async fn create_mute_rule_with_http_info(
&self,
- body: crate::datadogV2::model::SecurityMonitoringRuleCreatePayload,
+ body: crate::datadogV2::model::CreateMuteRuleParameters,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.create_security_monitoring_rule";
+ let operation_id = "v2.create_mute_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/rules",
+ "{}/api/v2/security/vulnerabilities/pipelines/mute_rules",
local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
@@ -1957,9 +2059,8 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
- &local_content,
- ) {
+ match serde_json::from_str::(&local_content)
+ {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -1970,7 +2071,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -1981,18 +2082,18 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a new suppression rule.
- pub async fn create_security_monitoring_suppression(
+ /// Create a security filter.
+ ///
+ /// See the [security filter guide]()
+ /// for more examples.
+ pub async fn create_security_filter(
&self,
- body: crate::datadogV2::model::SecurityMonitoringSuppressionCreateRequest,
+ body: crate::datadogV2::model::SecurityFilterCreateRequest,
) -> Result<
- crate::datadogV2::model::SecurityMonitoringSuppressionResponse,
- datadog::Error,
+ crate::datadogV2::model::SecurityFilterResponse,
+ datadog::Error,
> {
- match self
- .create_security_monitoring_suppression_with_http_info(body)
- .await
- {
+ match self.create_security_filter_with_http_info(body).await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -2006,21 +2107,24 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a new suppression rule.
- pub async fn create_security_monitoring_suppression_with_http_info(
+ /// Create a security filter.
+ ///
+ /// See the [security filter guide]()
+ /// for more examples.
+ pub async fn create_security_filter_with_http_info(
&self,
- body: crate::datadogV2::model::SecurityMonitoringSuppressionCreateRequest,
+ body: crate::datadogV2::model::SecurityFilterCreateRequest,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.create_security_monitoring_suppression";
+ let operation_id = "v2.create_security_filter";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/configuration/suppressions",
+ "{}/api/v2/security_monitoring/configuration/security_filters",
local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
@@ -2114,10 +2218,9 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::<
- crate::datadogV2::model::SecurityMonitoringSuppressionResponse,
- >(&local_content)
- {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -2128,7 +2231,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -2139,16 +2242,16 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a new notification rule for security signals and return the created rule.
- pub async fn create_signal_notification_rule(
+ /// Create a detection rule.
+ pub async fn create_security_monitoring_rule(
&self,
- body: crate::datadogV2::model::CreateNotificationRuleParameters,
+ body: crate::datadogV2::model::SecurityMonitoringRuleCreatePayload,
) -> Result<
- crate::datadogV2::model::NotificationRuleResponse,
- datadog::Error,
+ crate::datadogV2::model::SecurityMonitoringRuleResponse,
+ datadog::Error,
> {
match self
- .create_signal_notification_rule_with_http_info(body)
+ .create_security_monitoring_rule_with_http_info(body)
.await
{
Ok(response_content) => {
@@ -2164,21 +2267,21 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a new notification rule for security signals and return the created rule.
- pub async fn create_signal_notification_rule_with_http_info(
+ /// Create a detection rule.
+ pub async fn create_security_monitoring_rule_with_http_info(
&self,
- body: crate::datadogV2::model::CreateNotificationRuleParameters,
+ body: crate::datadogV2::model::SecurityMonitoringRuleCreatePayload,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.create_signal_notification_rule";
+ let operation_id = "v2.create_security_monitoring_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security/signals/notification_rules",
+ "{}/api/v2/security_monitoring/rules",
local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
@@ -2272,7 +2375,7 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
+ match serde_json::from_str::(
&local_content,
) {
Ok(e) => {
@@ -2285,7 +2388,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -2296,16 +2399,16 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a new notification rule for security vulnerabilities and return the created rule.
- pub async fn create_vulnerability_notification_rule(
+ /// Create a new suppression rule.
+ pub async fn create_security_monitoring_suppression(
&self,
- body: crate::datadogV2::model::CreateNotificationRuleParameters,
+ body: crate::datadogV2::model::SecurityMonitoringSuppressionCreateRequest,
) -> Result<
- crate::datadogV2::model::NotificationRuleResponse,
- datadog::Error,
+ crate::datadogV2::model::SecurityMonitoringSuppressionResponse,
+ datadog::Error,
> {
match self
- .create_vulnerability_notification_rule_with_http_info(body)
+ .create_security_monitoring_suppression_with_http_info(body)
.await
{
Ok(response_content) => {
@@ -2321,21 +2424,21 @@ impl SecurityMonitoringAPI {
}
}
- /// Create a new notification rule for security vulnerabilities and return the created rule.
- pub async fn create_vulnerability_notification_rule_with_http_info(
+ /// Create a new suppression rule.
+ pub async fn create_security_monitoring_suppression_with_http_info(
&self,
- body: crate::datadogV2::model::CreateNotificationRuleParameters,
+ body: crate::datadogV2::model::SecurityMonitoringSuppressionCreateRequest,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.create_vulnerability_notification_rule";
+ let operation_id = "v2.create_security_monitoring_suppression";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security/vulnerabilities/notification_rules",
+ "{}/api/v2/security_monitoring/configuration/suppressions",
local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
@@ -2429,9 +2532,10 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
- &local_content,
- ) {
+ match serde_json::from_str::<
+ crate::datadogV2::model::SecurityMonitoringSuppressionResponse,
+ >(&local_content)
+ {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -2442,7 +2546,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -2453,46 +2557,55 @@ impl SecurityMonitoringAPI {
}
}
- /// Delete an existing job.
- pub async fn delete_historical_job(
+ /// Create a new notification rule for security signals and return the created rule.
+ pub async fn create_signal_notification_rule(
&self,
- job_id: String,
- ) -> Result<(), datadog::Error> {
- match self.delete_historical_job_with_http_info(job_id).await {
- Ok(_) => Ok(()),
+ body: crate::datadogV2::model::CreateNotificationRuleParameters,
+ ) -> Result<
+ crate::datadogV2::model::NotificationRuleResponse,
+ datadog::Error,
+ > {
+ match self
+ .create_signal_notification_rule_with_http_info(body)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
Err(err) => Err(err),
}
}
- /// Delete an existing job.
- pub async fn delete_historical_job_with_http_info(
+ /// Create a new notification rule for security signals and return the created rule.
+ pub async fn create_signal_notification_rule_with_http_info(
&self,
- job_id: String,
- ) -> Result, datadog::Error> {
+ body: crate::datadogV2::model::CreateNotificationRuleParameters,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
let local_configuration = &self.config;
- let operation_id = "v2.delete_historical_job";
- if local_configuration.is_unstable_operation_enabled(operation_id) {
- warn!("Using unstable operation {operation_id}");
- } else {
- let local_error = datadog::UnstableOperationDisabledError {
- msg: "Operation 'v2.delete_historical_job' is not enabled".to_string(),
- };
- return Err(datadog::Error::UnstableOperationDisabledError(local_error));
- }
+ let operation_id = "v2.create_signal_notification_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/siem-historical-detections/jobs/{job_id}",
- local_configuration.get_operation_host(operation_id),
- job_id = datadog::urlencode(job_id)
+ "{}/api/v2/security/signals/notification_rules",
+ local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
- local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
+ local_client.request(reqwest::Method::POST, local_uri_str.as_str());
// build headers
let mut headers = HeaderMap::new();
- headers.insert("Accept", HeaderValue::from_static("*/*"));
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
// build user agent
match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
@@ -2522,6 +2635,51 @@ impl SecurityMonitoringAPI {
);
};
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
local_req_builder = local_req_builder.headers(headers);
let local_req = local_req_builder.build()?;
log::debug!("request content: {:?}", local_req.body());
@@ -2532,13 +2690,20 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- Ok(datadog::ResponseContent {
- status: local_status,
- content: local_content,
- entity: None,
- })
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -2549,41 +2714,55 @@ impl SecurityMonitoringAPI {
}
}
- /// Delete a specific security filter.
- pub async fn delete_security_filter(
+ /// Create a new notification rule for security vulnerabilities and return the created rule.
+ pub async fn create_vulnerability_notification_rule(
&self,
- security_filter_id: String,
- ) -> Result<(), datadog::Error> {
+ body: crate::datadogV2::model::CreateNotificationRuleParameters,
+ ) -> Result<
+ crate::datadogV2::model::NotificationRuleResponse,
+ datadog::Error,
+ > {
match self
- .delete_security_filter_with_http_info(security_filter_id)
+ .create_vulnerability_notification_rule_with_http_info(body)
.await
{
- Ok(_) => Ok(()),
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
+ Ok(e)
+ } else {
+ Err(datadog::Error::Serde(serde::de::Error::custom(
+ "response content was None",
+ )))
+ }
+ }
Err(err) => Err(err),
}
}
- /// Delete a specific security filter.
- pub async fn delete_security_filter_with_http_info(
+ /// Create a new notification rule for security vulnerabilities and return the created rule.
+ pub async fn create_vulnerability_notification_rule_with_http_info(
&self,
- security_filter_id: String,
- ) -> Result, datadog::Error> {
+ body: crate::datadogV2::model::CreateNotificationRuleParameters,
+ ) -> Result<
+ datadog::ResponseContent,
+ datadog::Error,
+ > {
let local_configuration = &self.config;
- let operation_id = "v2.delete_security_filter";
+ let operation_id = "v2.create_vulnerability_notification_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}",
- local_configuration.get_operation_host(operation_id),
- security_filter_id = datadog::urlencode(security_filter_id)
+ "{}/api/v2/security/vulnerabilities/notification_rules",
+ local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
- local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
+ local_client.request(reqwest::Method::POST, local_uri_str.as_str());
// build headers
let mut headers = HeaderMap::new();
- headers.insert("Accept", HeaderValue::from_static("*/*"));
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("application/json"));
// build user agent
match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
@@ -2613,6 +2792,51 @@ impl SecurityMonitoringAPI {
);
};
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
local_req_builder = local_req_builder.headers(headers);
let local_req = local_req_builder.build()?;
log::debug!("request content: {:?}", local_req.body());
@@ -2623,13 +2847,20 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- Ok(datadog::ResponseContent {
- status: local_status,
- content: local_content,
- entity: None,
- })
+ match serde_json::from_str::(
+ &local_content,
+ ) {
+ Ok(e) => {
+ return Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: Some(e),
+ })
+ }
+ Err(e) => return Err(datadog::Error::Serde(e)),
+ };
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -2640,35 +2871,39 @@ impl SecurityMonitoringAPI {
}
}
- /// Delete an existing rule. Default rules cannot be deleted.
- pub async fn delete_security_monitoring_rule(
+ /// Delete an existing job.
+ pub async fn delete_historical_job(
&self,
- rule_id: String,
- ) -> Result<(), datadog::Error> {
- match self
- .delete_security_monitoring_rule_with_http_info(rule_id)
- .await
- {
+ job_id: String,
+ ) -> Result<(), datadog::Error> {
+ match self.delete_historical_job_with_http_info(job_id).await {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
}
- /// Delete an existing rule. Default rules cannot be deleted.
- pub async fn delete_security_monitoring_rule_with_http_info(
+ /// Delete an existing job.
+ pub async fn delete_historical_job_with_http_info(
&self,
- rule_id: String,
- ) -> Result, datadog::Error>
- {
+ job_id: String,
+ ) -> Result, datadog::Error> {
let local_configuration = &self.config;
- let operation_id = "v2.delete_security_monitoring_rule";
+ let operation_id = "v2.delete_historical_job";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.delete_historical_job' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/rules/{rule_id}",
+ "{}/api/v2/siem-historical-detections/jobs/{job_id}",
local_configuration.get_operation_host(operation_id),
- rule_id = datadog::urlencode(rule_id)
+ job_id = datadog::urlencode(job_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
@@ -2721,7 +2956,7 @@ impl SecurityMonitoringAPI {
entity: None,
})
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -2732,37 +2967,31 @@ impl SecurityMonitoringAPI {
}
}
- /// Delete a specific suppression rule.
- pub async fn delete_security_monitoring_suppression(
+ /// Delete an inbox rule
+ pub async fn delete_inbox_rule(
&self,
- suppression_id: String,
- ) -> Result<(), datadog::Error> {
- match self
- .delete_security_monitoring_suppression_with_http_info(suppression_id)
- .await
- {
+ inbox_rule_id: uuid::Uuid,
+ ) -> Result<(), datadog::Error> {
+ match self.delete_inbox_rule_with_http_info(inbox_rule_id).await {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
}
- /// Delete a specific suppression rule.
- pub async fn delete_security_monitoring_suppression_with_http_info(
+ /// Delete an inbox rule
+ pub async fn delete_inbox_rule_with_http_info(
&self,
- suppression_id: String,
- ) -> Result<
- datadog::ResponseContent<()>,
- datadog::Error,
- > {
+ inbox_rule_id: uuid::Uuid,
+ ) -> Result, datadog::Error> {
let local_configuration = &self.config;
- let operation_id = "v2.delete_security_monitoring_suppression";
+ let operation_id = "v2.delete_inbox_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/configuration/suppressions/{suppression_id}",
+ "{}/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}",
local_configuration.get_operation_host(operation_id),
- suppression_id = datadog::urlencode(suppression_id)
+ inbox_rule_id = datadog::urlencode(inbox_rule_id.to_string())
);
let mut local_req_builder =
local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
@@ -2815,7 +3044,7 @@ impl SecurityMonitoringAPI {
entity: None,
})
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -2826,35 +3055,31 @@ impl SecurityMonitoringAPI {
}
}
- /// Delete a notification rule for security signals.
- pub async fn delete_signal_notification_rule(
+ /// Delete a mute rule
+ pub async fn delete_mute_rule(
&self,
- id: String,
- ) -> Result<(), datadog::Error> {
- match self
- .delete_signal_notification_rule_with_http_info(id)
- .await
- {
+ mute_rule_id: uuid::Uuid,
+ ) -> Result<(), datadog::Error> {
+ match self.delete_mute_rule_with_http_info(mute_rule_id).await {
Ok(_) => Ok(()),
Err(err) => Err(err),
}
}
- /// Delete a notification rule for security signals.
- pub async fn delete_signal_notification_rule_with_http_info(
+ /// Delete a mute rule
+ pub async fn delete_mute_rule_with_http_info(
&self,
- id: String,
- ) -> Result, datadog::Error>
- {
+ mute_rule_id: uuid::Uuid,
+ ) -> Result, datadog::Error> {
let local_configuration = &self.config;
- let operation_id = "v2.delete_signal_notification_rule";
+ let operation_id = "v2.delete_mute_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security/signals/notification_rules/{id}",
+ "{}/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}",
local_configuration.get_operation_host(operation_id),
- id = datadog::urlencode(id)
+ mute_rule_id = datadog::urlencode(mute_rule_id.to_string())
);
let mut local_req_builder =
local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
@@ -2907,7 +3132,7 @@ impl SecurityMonitoringAPI {
entity: None,
})
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -2918,13 +3143,13 @@ impl SecurityMonitoringAPI {
}
}
- /// Delete a notification rule for security vulnerabilities.
- pub async fn delete_vulnerability_notification_rule(
+ /// Delete a specific security filter.
+ pub async fn delete_security_filter(
&self,
- id: String,
- ) -> Result<(), datadog::Error> {
+ security_filter_id: String,
+ ) -> Result<(), datadog::Error> {
match self
- .delete_vulnerability_notification_rule_with_http_info(id)
+ .delete_security_filter_with_http_info(security_filter_id)
.await
{
Ok(_) => Ok(()),
@@ -2932,23 +3157,20 @@ impl SecurityMonitoringAPI {
}
}
- /// Delete a notification rule for security vulnerabilities.
- pub async fn delete_vulnerability_notification_rule_with_http_info(
+ /// Delete a specific security filter.
+ pub async fn delete_security_filter_with_http_info(
&self,
- id: String,
- ) -> Result<
- datadog::ResponseContent<()>,
- datadog::Error,
- > {
+ security_filter_id: String,
+ ) -> Result, datadog::Error> {
let local_configuration = &self.config;
- let operation_id = "v2.delete_vulnerability_notification_rule";
+ let operation_id = "v2.delete_security_filter";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security/vulnerabilities/notification_rules/{id}",
+ "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}",
local_configuration.get_operation_host(operation_id),
- id = datadog::urlencode(id)
+ security_filter_id = datadog::urlencode(security_filter_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
@@ -3001,7 +3223,7 @@ impl SecurityMonitoringAPI {
entity: None,
})
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -3012,60 +3234,42 @@ impl SecurityMonitoringAPI {
}
}
- /// Modify the triage assignee of a security signal.
- pub async fn edit_security_monitoring_signal_assignee(
+ /// Delete an existing rule. Default rules cannot be deleted.
+ pub async fn delete_security_monitoring_rule(
&self,
- signal_id: String,
- body: crate::datadogV2::model::SecurityMonitoringSignalAssigneeUpdateRequest,
- ) -> Result<
- crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
- datadog::Error,
- > {
+ rule_id: String,
+ ) -> Result<(), datadog::Error> {
match self
- .edit_security_monitoring_signal_assignee_with_http_info(signal_id, body)
+ .delete_security_monitoring_rule_with_http_info(rule_id)
.await
{
- Ok(response_content) => {
- if let Some(e) = response_content.entity {
- Ok(e)
- } else {
- Err(datadog::Error::Serde(serde::de::Error::custom(
- "response content was None",
- )))
- }
- }
+ Ok(_) => Ok(()),
Err(err) => Err(err),
}
}
- /// Modify the triage assignee of a security signal.
- pub async fn edit_security_monitoring_signal_assignee_with_http_info(
+ /// Delete an existing rule. Default rules cannot be deleted.
+ pub async fn delete_security_monitoring_rule_with_http_info(
&self,
- signal_id: String,
- body: crate::datadogV2::model::SecurityMonitoringSignalAssigneeUpdateRequest,
- ) -> Result<
- datadog::ResponseContent<
- crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
- >,
- datadog::Error,
- > {
+ rule_id: String,
+ ) -> Result, datadog::Error>
+ {
let local_configuration = &self.config;
- let operation_id = "v2.edit_security_monitoring_signal_assignee";
+ let operation_id = "v2.delete_security_monitoring_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/signals/{signal_id}/assignee",
+ "{}/api/v2/security_monitoring/rules/{rule_id}",
local_configuration.get_operation_host(operation_id),
- signal_id = datadog::urlencode(signal_id)
+ rule_id = datadog::urlencode(rule_id)
);
let mut local_req_builder =
- local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
+ local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
// build headers
let mut headers = HeaderMap::new();
- headers.insert("Content-Type", HeaderValue::from_static("application/json"));
- headers.insert("Accept", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("*/*"));
// build user agent
match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
@@ -3095,51 +3299,6 @@ impl SecurityMonitoringAPI {
);
};
- // build body parameters
- let output = Vec::new();
- let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
- if body.serialize(&mut ser).is_ok() {
- if let Some(content_encoding) = headers.get("Content-Encoding") {
- match content_encoding.to_str().unwrap_or_default() {
- "gzip" => {
- let mut enc = GzEncoder::new(Vec::new(), Compression::default());
- let _ = enc.write_all(ser.into_inner().as_slice());
- match enc.finish() {
- Ok(buf) => {
- local_req_builder = local_req_builder.body(buf);
- }
- Err(e) => return Err(datadog::Error::Io(e)),
- }
- }
- "deflate" => {
- let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
- let _ = enc.write_all(ser.into_inner().as_slice());
- match enc.finish() {
- Ok(buf) => {
- local_req_builder = local_req_builder.body(buf);
- }
- Err(e) => return Err(datadog::Error::Io(e)),
- }
- }
- "zstd1" => {
- let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
- let _ = enc.write_all(ser.into_inner().as_slice());
- match enc.finish() {
- Ok(buf) => {
- local_req_builder = local_req_builder.body(buf);
- }
- Err(e) => return Err(datadog::Error::Io(e)),
- }
- }
- _ => {
- local_req_builder = local_req_builder.body(ser.into_inner());
- }
- }
- } else {
- local_req_builder = local_req_builder.body(ser.into_inner());
- }
- }
-
local_req_builder = local_req_builder.headers(headers);
let local_req = local_req_builder.build()?;
log::debug!("request content: {:?}", local_req.body());
@@ -3150,21 +3309,13 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::<
- crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
- >(&local_content)
- {
- Ok(e) => {
- return Ok(datadog::ResponseContent {
- status: local_status,
- content: local_content,
- entity: Some(e),
- })
- }
- Err(e) => return Err(datadog::Error::Serde(e)),
- };
+ Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: None,
+ })
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -3175,60 +3326,44 @@ impl SecurityMonitoringAPI {
}
}
- /// Change the related incidents for a security signal.
- pub async fn edit_security_monitoring_signal_incidents(
+ /// Delete a specific suppression rule.
+ pub async fn delete_security_monitoring_suppression(
&self,
- signal_id: String,
- body: crate::datadogV2::model::SecurityMonitoringSignalIncidentsUpdateRequest,
- ) -> Result<
- crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
- datadog::Error,
- > {
+ suppression_id: String,
+ ) -> Result<(), datadog::Error> {
match self
- .edit_security_monitoring_signal_incidents_with_http_info(signal_id, body)
+ .delete_security_monitoring_suppression_with_http_info(suppression_id)
.await
{
- Ok(response_content) => {
- if let Some(e) = response_content.entity {
- Ok(e)
- } else {
- Err(datadog::Error::Serde(serde::de::Error::custom(
- "response content was None",
- )))
- }
- }
+ Ok(_) => Ok(()),
Err(err) => Err(err),
}
}
- /// Change the related incidents for a security signal.
- pub async fn edit_security_monitoring_signal_incidents_with_http_info(
+ /// Delete a specific suppression rule.
+ pub async fn delete_security_monitoring_suppression_with_http_info(
&self,
- signal_id: String,
- body: crate::datadogV2::model::SecurityMonitoringSignalIncidentsUpdateRequest,
+ suppression_id: String,
) -> Result<
- datadog::ResponseContent<
- crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
- >,
- datadog::Error,
+ datadog::ResponseContent<()>,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.edit_security_monitoring_signal_incidents";
+ let operation_id = "v2.delete_security_monitoring_suppression";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/signals/{signal_id}/incidents",
+ "{}/api/v2/security_monitoring/configuration/suppressions/{suppression_id}",
local_configuration.get_operation_host(operation_id),
- signal_id = datadog::urlencode(signal_id)
+ suppression_id = datadog::urlencode(suppression_id)
);
let mut local_req_builder =
- local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
+ local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
// build headers
let mut headers = HeaderMap::new();
- headers.insert("Content-Type", HeaderValue::from_static("application/json"));
- headers.insert("Accept", HeaderValue::from_static("application/json"));
+ headers.insert("Accept", HeaderValue::from_static("*/*"));
// build user agent
match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
@@ -3258,50 +3393,97 @@ impl SecurityMonitoringAPI {
);
};
- // build body parameters
- let output = Vec::new();
- let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
- if body.serialize(&mut ser).is_ok() {
- if let Some(content_encoding) = headers.get("Content-Encoding") {
- match content_encoding.to_str().unwrap_or_default() {
- "gzip" => {
- let mut enc = GzEncoder::new(Vec::new(), Compression::default());
- let _ = enc.write_all(ser.into_inner().as_slice());
- match enc.finish() {
- Ok(buf) => {
- local_req_builder = local_req_builder.body(buf);
- }
- Err(e) => return Err(datadog::Error::Io(e)),
- }
- }
- "deflate" => {
- let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
- let _ = enc.write_all(ser.into_inner().as_slice());
- match enc.finish() {
- Ok(buf) => {
- local_req_builder = local_req_builder.body(buf);
- }
- Err(e) => return Err(datadog::Error::Io(e)),
- }
- }
- "zstd1" => {
- let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
- let _ = enc.write_all(ser.into_inner().as_slice());
- match enc.finish() {
- Ok(buf) => {
- local_req_builder = local_req_builder.body(buf);
- }
- Err(e) => return Err(datadog::Error::Io(e)),
- }
- }
- _ => {
- local_req_builder = local_req_builder.body(ser.into_inner());
- }
- }
- } else {
- local_req_builder = local_req_builder.body(ser.into_inner());
- }
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: None,
+ })
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
+ };
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Delete a notification rule for security signals.
+ pub async fn delete_signal_notification_rule(
+ &self,
+ id: String,
+ ) -> Result<(), datadog::Error> {
+ match self
+ .delete_signal_notification_rule_with_http_info(id)
+ .await
+ {
+ Ok(_) => Ok(()),
+ Err(err) => Err(err),
}
+ }
+
+ /// Delete a notification rule for security signals.
+ pub async fn delete_signal_notification_rule_with_http_info(
+ &self,
+ id: String,
+ ) -> Result, datadog::Error>
+ {
+ let local_configuration = &self.config;
+ let operation_id = "v2.delete_signal_notification_rule";
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/security/signals/notification_rules/{id}",
+ local_configuration.get_operation_host(operation_id),
+ id = datadog::urlencode(id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("*/*"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
local_req_builder = local_req_builder.headers(headers);
let local_req = local_req_builder.build()?;
@@ -3313,21 +3495,107 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::<
- crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
- >(&local_content)
- {
- Ok(e) => {
- return Ok(datadog::ResponseContent {
- status: local_status,
- content: local_content,
- entity: Some(e),
- })
- }
- Err(e) => return Err(datadog::Error::Serde(e)),
+ Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: None,
+ })
+ } else {
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
+ let local_error = datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: local_entity,
};
+ Err(datadog::Error::ResponseError(local_error))
+ }
+ }
+
+ /// Delete a notification rule for security vulnerabilities.
+ pub async fn delete_vulnerability_notification_rule(
+ &self,
+ id: String,
+ ) -> Result<(), datadog::Error> {
+ match self
+ .delete_vulnerability_notification_rule_with_http_info(id)
+ .await
+ {
+ Ok(_) => Ok(()),
+ Err(err) => Err(err),
+ }
+ }
+
+ /// Delete a notification rule for security vulnerabilities.
+ pub async fn delete_vulnerability_notification_rule_with_http_info(
+ &self,
+ id: String,
+ ) -> Result<
+ datadog::ResponseContent<()>,
+ datadog::Error,
+ > {
+ let local_configuration = &self.config;
+ let operation_id = "v2.delete_vulnerability_notification_rule";
+
+ let local_client = &self.client;
+
+ let local_uri_str = format!(
+ "{}/api/v2/security/vulnerabilities/notification_rules/{id}",
+ local_configuration.get_operation_host(operation_id),
+ id = datadog::urlencode(id)
+ );
+ let mut local_req_builder =
+ local_client.request(reqwest::Method::DELETE, local_uri_str.as_str());
+
+ // build headers
+ let mut headers = HeaderMap::new();
+ headers.insert("Accept", HeaderValue::from_static("*/*"));
+
+ // build user agent
+ match HeaderValue::from_str(local_configuration.user_agent.as_str()) {
+ Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent),
+ Err(e) => {
+ log::warn!("Failed to parse user agent header: {e}, falling back to default");
+ headers.insert(
+ reqwest::header::USER_AGENT,
+ HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()),
+ )
+ }
+ };
+
+ // build auth
+ if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") {
+ headers.insert(
+ "DD-API-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-API-KEY header"),
+ );
+ };
+ if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") {
+ headers.insert(
+ "DD-APPLICATION-KEY",
+ HeaderValue::from_str(local_key.key.as_str())
+ .expect("failed to parse DD-APPLICATION-KEY header"),
+ );
+ };
+
+ local_req_builder = local_req_builder.headers(headers);
+ let local_req = local_req_builder.build()?;
+ log::debug!("request content: {:?}", local_req.body());
+ let local_resp = local_client.execute(local_req).await?;
+
+ let local_status = local_resp.status();
+ let local_content = local_resp.text().await?;
+ log::debug!("response content: {}", local_content);
+
+ if !local_status.is_client_error() && !local_status.is_server_error() {
+ Ok(datadog::ResponseContent {
+ status: local_status,
+ content: local_content,
+ entity: None,
+ })
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -3338,17 +3606,17 @@ impl SecurityMonitoringAPI {
}
}
- /// Change the triage state of a security signal.
- pub async fn edit_security_monitoring_signal_state(
+ /// Modify the triage assignee of a security signal.
+ pub async fn edit_security_monitoring_signal_assignee(
&self,
signal_id: String,
- body: crate::datadogV2::model::SecurityMonitoringSignalStateUpdateRequest,
+ body: crate::datadogV2::model::SecurityMonitoringSignalAssigneeUpdateRequest,
) -> Result<
crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
- datadog::Error,
+ datadog::Error,
> {
match self
- .edit_security_monitoring_signal_state_with_http_info(signal_id, body)
+ .edit_security_monitoring_signal_assignee_with_http_info(signal_id, body)
.await
{
Ok(response_content) => {
@@ -3364,24 +3632,24 @@ impl SecurityMonitoringAPI {
}
}
- /// Change the triage state of a security signal.
- pub async fn edit_security_monitoring_signal_state_with_http_info(
+ /// Modify the triage assignee of a security signal.
+ pub async fn edit_security_monitoring_signal_assignee_with_http_info(
&self,
signal_id: String,
- body: crate::datadogV2::model::SecurityMonitoringSignalStateUpdateRequest,
+ body: crate::datadogV2::model::SecurityMonitoringSignalAssigneeUpdateRequest,
) -> Result<
datadog::ResponseContent<
crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
>,
- datadog::Error,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.edit_security_monitoring_signal_state";
+ let operation_id = "v2.edit_security_monitoring_signal_assignee";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/signals/{signal_id}/state",
+ "{}/api/v2/security_monitoring/signals/{signal_id}/assignee",
local_configuration.get_operation_host(operation_id),
signal_id = datadog::urlencode(signal_id)
);
@@ -3490,7 +3758,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -3501,15 +3769,21 @@ impl SecurityMonitoringAPI {
}
}
- /// Returns a single finding with message and resource configuration.
- pub async fn get_finding(
+ /// Change the related incidents for a security signal.
+ pub async fn edit_security_monitoring_signal_incidents(
&self,
- finding_id: String,
- params: GetFindingOptionalParams,
- ) -> Result> {
- match self.get_finding_with_http_info(finding_id, params).await {
- Ok(response_content) => {
- if let Some(e) = response_content.entity {
+ signal_id: String,
+ body: crate::datadogV2::model::SecurityMonitoringSignalIncidentsUpdateRequest,
+ ) -> Result<
+ crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
+ datadog::Error,
+ > {
+ match self
+ .edit_security_monitoring_signal_incidents_with_http_info(signal_id, body)
+ .await
+ {
+ Ok(response_content) => {
+ if let Some(e) = response_content.entity {
Ok(e)
} else {
Err(datadog::Error::Serde(serde::de::Error::custom(
@@ -3521,46 +3795,33 @@ impl SecurityMonitoringAPI {
}
}
- /// Returns a single finding with message and resource configuration.
- pub async fn get_finding_with_http_info(
+ /// Change the related incidents for a security signal.
+ pub async fn edit_security_monitoring_signal_incidents_with_http_info(
&self,
- finding_id: String,
- params: GetFindingOptionalParams,
+ signal_id: String,
+ body: crate::datadogV2::model::SecurityMonitoringSignalIncidentsUpdateRequest,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent<
+ crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
+ >,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_finding";
- if local_configuration.is_unstable_operation_enabled(operation_id) {
- warn!("Using unstable operation {operation_id}");
- } else {
- let local_error = datadog::UnstableOperationDisabledError {
- msg: "Operation 'v2.get_finding' is not enabled".to_string(),
- };
- return Err(datadog::Error::UnstableOperationDisabledError(local_error));
- }
-
- // unbox and build optional parameters
- let snapshot_timestamp = params.snapshot_timestamp;
+ let operation_id = "v2.edit_security_monitoring_signal_incidents";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/posture_management/findings/{finding_id}",
+ "{}/api/v2/security_monitoring/signals/{signal_id}/incidents",
local_configuration.get_operation_host(operation_id),
- finding_id = datadog::urlencode(finding_id)
+ signal_id = datadog::urlencode(signal_id)
);
let mut local_req_builder =
- local_client.request(reqwest::Method::GET, local_uri_str.as_str());
-
- if let Some(ref local_query_param) = snapshot_timestamp {
- local_req_builder =
- local_req_builder.query(&[("snapshot_timestamp", &local_query_param.to_string())]);
- };
+ local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
// build headers
let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
headers.insert("Accept", HeaderValue::from_static("application/json"));
// build user agent
@@ -3591,6 +3852,51 @@ impl SecurityMonitoringAPI {
);
};
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
local_req_builder = local_req_builder.headers(headers);
let local_req = local_req_builder.build()?;
log::debug!("request content: {:?}", local_req.body());
@@ -3601,9 +3907,10 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
- &local_content,
- ) {
+ match serde_json::from_str::<
+ crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
+ >(&local_content)
+ {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -3614,7 +3921,8 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option = serde_json::from_str(&local_content).ok();
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
@@ -3624,13 +3932,19 @@ impl SecurityMonitoringAPI {
}
}
- /// Get a job's details.
- pub async fn get_historical_job(
+ /// Change the triage state of a security signal.
+ pub async fn edit_security_monitoring_signal_state(
&self,
- job_id: String,
- ) -> Result>
- {
- match self.get_historical_job_with_http_info(job_id).await {
+ signal_id: String,
+ body: crate::datadogV2::model::SecurityMonitoringSignalStateUpdateRequest,
+ ) -> Result<
+ crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
+ datadog::Error,
+ > {
+ match self
+ .edit_security_monitoring_signal_state_with_http_info(signal_id, body)
+ .await
+ {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -3644,37 +3958,33 @@ impl SecurityMonitoringAPI {
}
}
- /// Get a job's details.
- pub async fn get_historical_job_with_http_info(
+ /// Change the triage state of a security signal.
+ pub async fn edit_security_monitoring_signal_state_with_http_info(
&self,
- job_id: String,
+ signal_id: String,
+ body: crate::datadogV2::model::SecurityMonitoringSignalStateUpdateRequest,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent<
+ crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
+ >,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_historical_job";
- if local_configuration.is_unstable_operation_enabled(operation_id) {
- warn!("Using unstable operation {operation_id}");
- } else {
- let local_error = datadog::UnstableOperationDisabledError {
- msg: "Operation 'v2.get_historical_job' is not enabled".to_string(),
- };
- return Err(datadog::Error::UnstableOperationDisabledError(local_error));
- }
+ let operation_id = "v2.edit_security_monitoring_signal_state";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/siem-historical-detections/jobs/{job_id}",
+ "{}/api/v2/security_monitoring/signals/{signal_id}/state",
local_configuration.get_operation_host(operation_id),
- job_id = datadog::urlencode(job_id)
+ signal_id = datadog::urlencode(signal_id)
);
let mut local_req_builder =
- local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+ local_client.request(reqwest::Method::PATCH, local_uri_str.as_str());
// build headers
let mut headers = HeaderMap::new();
+ headers.insert("Content-Type", HeaderValue::from_static("application/json"));
headers.insert("Accept", HeaderValue::from_static("application/json"));
// build user agent
@@ -3705,6 +4015,51 @@ impl SecurityMonitoringAPI {
);
};
+ // build body parameters
+ let output = Vec::new();
+ let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter);
+ if body.serialize(&mut ser).is_ok() {
+ if let Some(content_encoding) = headers.get("Content-Encoding") {
+ match content_encoding.to_str().unwrap_or_default() {
+ "gzip" => {
+ let mut enc = GzEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "deflate" => {
+ let mut enc = ZlibEncoder::new(Vec::new(), Compression::default());
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ "zstd1" => {
+ let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap();
+ let _ = enc.write_all(ser.into_inner().as_slice());
+ match enc.finish() {
+ Ok(buf) => {
+ local_req_builder = local_req_builder.body(buf);
+ }
+ Err(e) => return Err(datadog::Error::Io(e)),
+ }
+ }
+ _ => {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+ } else {
+ local_req_builder = local_req_builder.body(ser.into_inner());
+ }
+ }
+
local_req_builder = local_req_builder.headers(headers);
let local_req = local_req_builder.build()?;
log::debug!("request content: {:?}", local_req.body());
@@ -3715,9 +4070,10 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
- &local_content,
- ) {
+ match serde_json::from_str::<
+ crate::datadogV2::model::SecurityMonitoringSignalTriageUpdateResponse,
+ >(&local_content)
+ {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -3728,7 +4084,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -3739,18 +4095,13 @@ impl SecurityMonitoringAPI {
}
}
- /// Get a single SBOM related to an asset by its type and name.
- ///
- pub async fn get_sbom(
+ /// Returns a single finding with message and resource configuration.
+ pub async fn get_finding(
&self,
- asset_type: crate::datadogV2::model::AssetType,
- filter_asset_name: String,
- params: GetSBOMOptionalParams,
- ) -> Result> {
- match self
- .get_sbom_with_http_info(asset_type, filter_asset_name, params)
- .await
- {
+ finding_id: String,
+ params: GetFindingOptionalParams,
+ ) -> Result> {
+ match self.get_finding_with_http_info(finding_id, params).await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -3764,46 +4115,42 @@ impl SecurityMonitoringAPI {
}
}
- /// Get a single SBOM related to an asset by its type and name.
- ///
- pub async fn get_sbom_with_http_info(
+ /// Returns a single finding with message and resource configuration.
+ pub async fn get_finding_with_http_info(
&self,
- asset_type: crate::datadogV2::model::AssetType,
- filter_asset_name: String,
- params: GetSBOMOptionalParams,
+ finding_id: String,
+ params: GetFindingOptionalParams,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_sbom";
+ let operation_id = "v2.get_finding";
if local_configuration.is_unstable_operation_enabled(operation_id) {
warn!("Using unstable operation {operation_id}");
} else {
let local_error = datadog::UnstableOperationDisabledError {
- msg: "Operation 'v2.get_sbom' is not enabled".to_string(),
+ msg: "Operation 'v2.get_finding' is not enabled".to_string(),
};
return Err(datadog::Error::UnstableOperationDisabledError(local_error));
}
// unbox and build optional parameters
- let filter_repo_digest = params.filter_repo_digest;
+ let snapshot_timestamp = params.snapshot_timestamp;
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security/sboms/{asset_type}",
+ "{}/api/v2/posture_management/findings/{finding_id}",
local_configuration.get_operation_host(operation_id),
- asset_type = datadog::urlencode(asset_type.to_string())
+ finding_id = datadog::urlencode(finding_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
- local_req_builder =
- local_req_builder.query(&[("filter[asset_name]", &filter_asset_name.to_string())]);
- if let Some(ref local_query_param) = filter_repo_digest {
+ if let Some(ref local_query_param) = snapshot_timestamp {
local_req_builder =
- local_req_builder.query(&[("filter[repo_digest]", &local_query_param.to_string())]);
+ local_req_builder.query(&[("snapshot_timestamp", &local_query_param.to_string())]);
};
// build headers
@@ -3848,7 +4195,9 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(&local_content) {
+ match serde_json::from_str::(
+ &local_content,
+ ) {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -3859,7 +4208,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option = serde_json::from_str(&local_content).ok();
+ let local_entity: Option = serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
@@ -3869,21 +4218,13 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the details of a specific security filter.
- ///
- /// See the [security filter guide]()
- /// for more examples.
- pub async fn get_security_filter(
+ /// Get a job's details.
+ pub async fn get_historical_job(
&self,
- security_filter_id: String,
- ) -> Result<
- crate::datadogV2::model::SecurityFilterResponse,
- datadog::Error,
- > {
- match self
- .get_security_filter_with_http_info(security_filter_id)
- .await
- {
+ job_id: String,
+ ) -> Result>
+ {
+ match self.get_historical_job_with_http_info(job_id).await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -3897,26 +4238,31 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the details of a specific security filter.
- ///
- /// See the [security filter guide]()
- /// for more examples.
- pub async fn get_security_filter_with_http_info(
+ /// Get a job's details.
+ pub async fn get_historical_job_with_http_info(
&self,
- security_filter_id: String,
+ job_id: String,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_security_filter";
+ let operation_id = "v2.get_historical_job";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.get_historical_job' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}",
+ "{}/api/v2/siem-historical-detections/jobs/{job_id}",
local_configuration.get_operation_host(operation_id),
- security_filter_id = datadog::urlencode(security_filter_id)
+ job_id = datadog::urlencode(job_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
@@ -3963,7 +4309,7 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
+ match serde_json::from_str::(
&local_content,
) {
Ok(e) => {
@@ -3976,7 +4322,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -3987,18 +4333,12 @@ impl SecurityMonitoringAPI {
}
}
- /// Get a rule's details.
- pub async fn get_security_monitoring_rule(
+ /// Get the details of an inbox rule.
+ pub async fn get_inbox_rule(
&self,
- rule_id: String,
- ) -> Result<
- crate::datadogV2::model::SecurityMonitoringRuleResponse,
- datadog::Error,
- > {
- match self
- .get_security_monitoring_rule_with_http_info(rule_id)
- .await
- {
+ inbox_rule_id: uuid::Uuid,
+ ) -> Result> {
+ match self.get_inbox_rule_with_http_info(inbox_rule_id).await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -4012,23 +4352,23 @@ impl SecurityMonitoringAPI {
}
}
- /// Get a rule's details.
- pub async fn get_security_monitoring_rule_with_http_info(
+ /// Get the details of an inbox rule.
+ pub async fn get_inbox_rule_with_http_info(
&self,
- rule_id: String,
+ inbox_rule_id: uuid::Uuid,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_security_monitoring_rule";
+ let operation_id = "v2.get_inbox_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/rules/{rule_id}",
+ "{}/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}",
local_configuration.get_operation_host(operation_id),
- rule_id = datadog::urlencode(rule_id)
+ inbox_rule_id = datadog::urlencode(inbox_rule_id.to_string())
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
@@ -4075,9 +4415,8 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
- &local_content,
- ) {
+ match serde_json::from_str::(&local_content)
+ {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -4088,8 +4427,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
- serde_json::from_str(&local_content).ok();
+ let local_entity: Option = serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
@@ -4099,18 +4437,14 @@ impl SecurityMonitoringAPI {
}
}
- /// Get a signal's details.
- pub async fn get_security_monitoring_signal(
+ /// Returns the ordered list of inbox rules in the pipeline (first match applies)
+ pub async fn get_inbox_rules(
&self,
- signal_id: String,
) -> Result<
- crate::datadogV2::model::SecurityMonitoringSignalResponse,
- datadog::Error,
+ std::collections::BTreeMap,
+ datadog::Error,
> {
- match self
- .get_security_monitoring_signal_with_http_info(signal_id)
- .await
- {
+ match self.get_inbox_rules_with_http_info().await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -4124,23 +4458,21 @@ impl SecurityMonitoringAPI {
}
}
- /// Get a signal's details.
- pub async fn get_security_monitoring_signal_with_http_info(
+ /// Returns the ordered list of inbox rules in the pipeline (first match applies)
+ pub async fn get_inbox_rules_with_http_info(
&self,
- signal_id: String,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent>,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_security_monitoring_signal";
+ let operation_id = "v2.get_inbox_rules";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/signals/{signal_id}",
- local_configuration.get_operation_host(operation_id),
- signal_id = datadog::urlencode(signal_id)
+ "{}/api/v2/security/vulnerabilities/pipelines/inbox_rules",
+ local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
@@ -4187,7 +4519,7 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
+ match serde_json::from_str::>(
&local_content,
) {
Ok(e) => {
@@ -4200,7 +4532,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -4211,18 +4543,12 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the details of a specific suppression rule.
- pub async fn get_security_monitoring_suppression(
+ /// Get the details of a mute rule.
+ pub async fn get_mute_rule(
&self,
- suppression_id: String,
- ) -> Result<
- crate::datadogV2::model::SecurityMonitoringSuppressionResponse,
- datadog::Error,
- > {
- match self
- .get_security_monitoring_suppression_with_http_info(suppression_id)
- .await
- {
+ mute_rule_id: uuid::Uuid,
+ ) -> Result> {
+ match self.get_mute_rule_with_http_info(mute_rule_id).await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -4236,23 +4562,23 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the details of a specific suppression rule.
- pub async fn get_security_monitoring_suppression_with_http_info(
+ /// Get the details of a mute rule.
+ pub async fn get_mute_rule_with_http_info(
&self,
- suppression_id: String,
+ mute_rule_id: uuid::Uuid,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_security_monitoring_suppression";
+ let operation_id = "v2.get_mute_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security_monitoring/configuration/suppressions/{suppression_id}",
+ "{}/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}",
local_configuration.get_operation_host(operation_id),
- suppression_id = datadog::urlencode(suppression_id)
+ mute_rule_id = datadog::urlencode(mute_rule_id.to_string())
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
@@ -4299,9 +4625,7 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::<
- crate::datadogV2::model::SecurityMonitoringSuppressionResponse,
- >(&local_content)
+ match serde_json::from_str::(&local_content)
{
Ok(e) => {
return Ok(datadog::ResponseContent {
@@ -4313,8 +4637,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
- serde_json::from_str(&local_content).ok();
+ let local_entity: Option = serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
@@ -4324,15 +4647,14 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the details of a notification rule for security signals.
- pub async fn get_signal_notification_rule(
+ /// Returns the ordered list of mute rules in the pipeline (first match applies)
+ pub async fn get_mute_rules(
&self,
- id: String,
) -> Result<
- crate::datadogV2::model::NotificationRuleResponse,
- datadog::Error,
+ std::collections::BTreeMap,
+ datadog::Error,
> {
- match self.get_signal_notification_rule_with_http_info(id).await {
+ match self.get_mute_rules_with_http_info().await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -4346,23 +4668,21 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the details of a notification rule for security signals.
- pub async fn get_signal_notification_rule_with_http_info(
+ /// Returns the ordered list of mute rules in the pipeline (first match applies)
+ pub async fn get_mute_rules_with_http_info(
&self,
- id: String,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent>,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_signal_notification_rule";
+ let operation_id = "v2.get_mute_rules";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security/signals/notification_rules/{id}",
- local_configuration.get_operation_host(operation_id),
- id = datadog::urlencode(id)
+ "{}/api/v2/security/vulnerabilities/pipelines/mute_rules",
+ local_configuration.get_operation_host(operation_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
@@ -4409,7 +4729,7 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
+ match serde_json::from_str::>(
&local_content,
) {
Ok(e) => {
@@ -4422,8 +4742,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
- serde_json::from_str(&local_content).ok();
+ let local_entity: Option = serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
@@ -4433,14 +4752,18 @@ impl SecurityMonitoringAPI {
}
}
- /// Returns the list of notification rules for security signals.
- pub async fn get_signal_notification_rules(
+ /// Get a single SBOM related to an asset by its type and name.
+ ///
+ pub async fn get_sbom(
&self,
- ) -> Result<
- std::collections::BTreeMap,
- datadog::Error,
- > {
- match self.get_signal_notification_rules_with_http_info().await {
+ asset_type: crate::datadogV2::model::AssetType,
+ filter_asset_name: String,
+ params: GetSBOMOptionalParams,
+ ) -> Result> {
+ match self
+ .get_sbom_with_http_info(asset_type, filter_asset_name, params)
+ .await
+ {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -4454,25 +4777,48 @@ impl SecurityMonitoringAPI {
}
}
- /// Returns the list of notification rules for security signals.
- pub async fn get_signal_notification_rules_with_http_info(
+ /// Get a single SBOM related to an asset by its type and name.
+ ///
+ pub async fn get_sbom_with_http_info(
&self,
+ asset_type: crate::datadogV2::model::AssetType,
+ filter_asset_name: String,
+ params: GetSBOMOptionalParams,
) -> Result<
- datadog::ResponseContent>,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_signal_notification_rules";
+ let operation_id = "v2.get_sbom";
+ if local_configuration.is_unstable_operation_enabled(operation_id) {
+ warn!("Using unstable operation {operation_id}");
+ } else {
+ let local_error = datadog::UnstableOperationDisabledError {
+ msg: "Operation 'v2.get_sbom' is not enabled".to_string(),
+ };
+ return Err(datadog::Error::UnstableOperationDisabledError(local_error));
+ }
+
+ // unbox and build optional parameters
+ let filter_repo_digest = params.filter_repo_digest;
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security/signals/notification_rules",
- local_configuration.get_operation_host(operation_id)
+ "{}/api/v2/security/sboms/{asset_type}",
+ local_configuration.get_operation_host(operation_id),
+ asset_type = datadog::urlencode(asset_type.to_string())
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
+ local_req_builder =
+ local_req_builder.query(&[("filter[asset_name]", &filter_asset_name.to_string())]);
+ if let Some(ref local_query_param) = filter_repo_digest {
+ local_req_builder =
+ local_req_builder.query(&[("filter[repo_digest]", &local_query_param.to_string())]);
+ };
+
// build headers
let mut headers = HeaderMap::new();
headers.insert("Accept", HeaderValue::from_static("application/json"));
@@ -4515,9 +4861,7 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::>(
- &local_content,
- ) {
+ match serde_json::from_str::(&local_content) {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -4528,8 +4872,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
- serde_json::from_str(&local_content).ok();
+ let local_entity: Option = serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
@@ -4539,16 +4882,19 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the details of a notification rule for security vulnerabilities.
- pub async fn get_vulnerability_notification_rule(
+ /// Get the details of a specific security filter.
+ ///
+ /// See the [security filter guide]()
+ /// for more examples.
+ pub async fn get_security_filter(
&self,
- id: String,
+ security_filter_id: String,
) -> Result<
- crate::datadogV2::model::NotificationRuleResponse,
- datadog::Error,
+ crate::datadogV2::model::SecurityFilterResponse,
+ datadog::Error,
> {
match self
- .get_vulnerability_notification_rule_with_http_info(id)
+ .get_security_filter_with_http_info(security_filter_id)
.await
{
Ok(response_content) => {
@@ -4564,23 +4910,26 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the details of a notification rule for security vulnerabilities.
- pub async fn get_vulnerability_notification_rule_with_http_info(
+ /// Get the details of a specific security filter.
+ ///
+ /// See the [security filter guide]()
+ /// for more examples.
+ pub async fn get_security_filter_with_http_info(
&self,
- id: String,
+ security_filter_id: String,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_vulnerability_notification_rule";
+ let operation_id = "v2.get_security_filter";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security/vulnerabilities/notification_rules/{id}",
+ "{}/api/v2/security_monitoring/configuration/security_filters/{security_filter_id}",
local_configuration.get_operation_host(operation_id),
- id = datadog::urlencode(id)
+ security_filter_id = datadog::urlencode(security_filter_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
@@ -4627,7 +4976,7 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
+ match serde_json::from_str::(
&local_content,
) {
Ok(e) => {
@@ -4640,7 +4989,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -4651,15 +5000,16 @@ impl SecurityMonitoringAPI {
}
}
- /// Returns the list of notification rules for security vulnerabilities.
- pub async fn get_vulnerability_notification_rules(
+ /// Get a rule's details.
+ pub async fn get_security_monitoring_rule(
&self,
+ rule_id: String,
) -> Result<
- std::collections::BTreeMap,
- datadog::Error,
+ crate::datadogV2::model::SecurityMonitoringRuleResponse,
+ datadog::Error,
> {
match self
- .get_vulnerability_notification_rules_with_http_info()
+ .get_security_monitoring_rule_with_http_info(rule_id)
.await
{
Ok(response_content) => {
@@ -4675,21 +5025,23 @@ impl SecurityMonitoringAPI {
}
}
- /// Returns the list of notification rules for security vulnerabilities.
- pub async fn get_vulnerability_notification_rules_with_http_info(
+ /// Get a rule's details.
+ pub async fn get_security_monitoring_rule_with_http_info(
&self,
+ rule_id: String,
) -> Result<
- datadog::ResponseContent>,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.get_vulnerability_notification_rules";
+ let operation_id = "v2.get_security_monitoring_rule";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/security/vulnerabilities/notification_rules",
- local_configuration.get_operation_host(operation_id)
+ "{}/api/v2/security_monitoring/rules/{rule_id}",
+ local_configuration.get_operation_host(operation_id),
+ rule_id = datadog::urlencode(rule_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
@@ -4736,7 +5088,7 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::>(
+ match serde_json::from_str::(
&local_content,
) {
Ok(e) => {
@@ -4749,7 +5101,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -4760,45 +5112,18 @@ impl SecurityMonitoringAPI {
}
}
- /// 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.
- ///
- /// ### 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.
- ///
- pub async fn list_findings(
+ /// Get a signal's details.
+ pub async fn get_security_monitoring_signal(
&self,
- params: ListFindingsOptionalParams,
- ) -> Result>
- {
- match self.list_findings_with_http_info(params).await {
+ signal_id: String,
+ ) -> Result<
+ crate::datadogV2::model::SecurityMonitoringSignalResponse,
+ datadog::Error,
+ > {
+ match self
+ .get_security_monitoring_signal_with_http_info(signal_id)
+ .await
+ {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -4812,173 +5137,27 @@ impl SecurityMonitoringAPI {
}
}
- pub fn list_findings_with_pagination(
- &self,
- mut params: ListFindingsOptionalParams,
- ) -> impl Stream<
- Item = Result>,
- > + '_ {
- try_stream! {
- let mut page_size: i64 = 100;
- if params.page_limit.is_none() {
- params.page_limit = Some(page_size);
- } else {
- page_size = params.page_limit.unwrap().clone();
- }
- loop {
- let resp = self.list_findings(params.clone()).await?;
-
- let r = resp.data;
- let count = r.len();
- for team in r {
- yield team;
- }
-
- if count < page_size as usize {
- break;
- }
- let Some(page) = resp.meta.page else { break };
- let Some(cursor) = page.cursor else { break };
-
- params.page_cursor = Some(cursor);
- }
- }
- }
-
- /// 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.
- ///
- /// ### 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.
- ///
- pub async fn list_findings_with_http_info(
+ /// Get a signal's details.
+ pub async fn get_security_monitoring_signal_with_http_info(
&self,
- params: ListFindingsOptionalParams,
+ signal_id: String,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.list_findings";
- if local_configuration.is_unstable_operation_enabled(operation_id) {
- warn!("Using unstable operation {operation_id}");
- } else {
- let local_error = datadog::UnstableOperationDisabledError {
- msg: "Operation 'v2.list_findings' is not enabled".to_string(),
- };
- return Err(datadog::Error::UnstableOperationDisabledError(local_error));
- }
-
- // unbox and build optional parameters
- let page_limit = params.page_limit;
- let snapshot_timestamp = params.snapshot_timestamp;
- let page_cursor = params.page_cursor;
- let filter_tags = params.filter_tags;
- let filter_evaluation_changed_at = params.filter_evaluation_changed_at;
- let filter_muted = params.filter_muted;
- let filter_rule_id = params.filter_rule_id;
- let filter_rule_name = params.filter_rule_name;
- let filter_resource_type = params.filter_resource_type;
- let filter_discovery_timestamp = params.filter_discovery_timestamp;
- let filter_evaluation = params.filter_evaluation;
- let filter_status = params.filter_status;
- let filter_vulnerability_type = params.filter_vulnerability_type;
+ let operation_id = "v2.get_security_monitoring_signal";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/posture_management/findings",
- local_configuration.get_operation_host(operation_id)
+ "{}/api/v2/security_monitoring/signals/{signal_id}",
+ local_configuration.get_operation_host(operation_id),
+ signal_id = datadog::urlencode(signal_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
- if let Some(ref local_query_param) = page_limit {
- local_req_builder =
- local_req_builder.query(&[("page[limit]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = snapshot_timestamp {
- local_req_builder =
- local_req_builder.query(&[("snapshot_timestamp", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = page_cursor {
- local_req_builder =
- local_req_builder.query(&[("page[cursor]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = filter_tags {
- local_req_builder =
- local_req_builder.query(&[("filter[tags]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = filter_evaluation_changed_at {
- local_req_builder = local_req_builder.query(&[(
- "filter[evaluation_changed_at]",
- &local_query_param.to_string(),
- )]);
- };
- if let Some(ref local_query_param) = filter_muted {
- local_req_builder =
- local_req_builder.query(&[("filter[muted]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = filter_rule_id {
- local_req_builder =
- local_req_builder.query(&[("filter[rule_id]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = filter_rule_name {
- local_req_builder =
- local_req_builder.query(&[("filter[rule_name]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = filter_resource_type {
- local_req_builder = local_req_builder
- .query(&[("filter[resource_type]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = filter_discovery_timestamp {
- local_req_builder = local_req_builder.query(&[(
- "filter[discovery_timestamp]",
- &local_query_param.to_string(),
- )]);
- };
- if let Some(ref local_query_param) = filter_evaluation {
- local_req_builder =
- local_req_builder.query(&[("filter[evaluation]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = filter_status {
- local_req_builder =
- local_req_builder.query(&[("filter[status]", &local_query_param.to_string())]);
- };
- if let Some(ref local) = filter_vulnerability_type {
- for param in local {
- local_req_builder =
- local_req_builder.query(&[("filter[vulnerability_type]", ¶m.to_string())]);
- }
- };
-
// build headers
let mut headers = HeaderMap::new();
headers.insert("Accept", HeaderValue::from_static("application/json"));
@@ -5021,7 +5200,7 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
+ match serde_json::from_str::(
&local_content,
) {
Ok(e) => {
@@ -5034,7 +5213,8 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option = serde_json::from_str(&local_content).ok();
+ let local_entity: Option =
+ serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
content: local_content,
@@ -5044,16 +5224,19 @@ impl SecurityMonitoringAPI {
}
}
- /// List historical jobs.
- pub async fn list_historical_jobs(
+ /// Get the details of a specific suppression rule.
+ pub async fn get_security_monitoring_suppression(
&self,
- params: ListHistoricalJobsOptionalParams,
+ suppression_id: String,
) -> Result<
- crate::datadogV2::model::ListHistoricalJobsResponse,
- datadog::Error,
+ crate::datadogV2::model::SecurityMonitoringSuppressionResponse,
+ datadog::Error,
> {
- match self.list_historical_jobs_with_http_info(params).await {
- Ok(response_content) => {
+ match self
+ .get_security_monitoring_suppression_with_http_info(suppression_id)
+ .await
+ {
+ Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
} else {
@@ -5066,57 +5249,27 @@ impl SecurityMonitoringAPI {
}
}
- /// List historical jobs.
- pub async fn list_historical_jobs_with_http_info(
+ /// Get the details of a specific suppression rule.
+ pub async fn get_security_monitoring_suppression_with_http_info(
&self,
- params: ListHistoricalJobsOptionalParams,
+ suppression_id: String,
) -> Result<
- datadog::ResponseContent,
- datadog::Error,
+ datadog::ResponseContent,
+ datadog::Error,
> {
let local_configuration = &self.config;
- let operation_id = "v2.list_historical_jobs";
- if local_configuration.is_unstable_operation_enabled(operation_id) {
- warn!("Using unstable operation {operation_id}");
- } else {
- let local_error = datadog::UnstableOperationDisabledError {
- msg: "Operation 'v2.list_historical_jobs' is not enabled".to_string(),
- };
- return Err(datadog::Error::UnstableOperationDisabledError(local_error));
- }
-
- // unbox and build optional parameters
- let page_size = params.page_size;
- let page_number = params.page_number;
- let sort = params.sort;
- let filter_query = params.filter_query;
+ let operation_id = "v2.get_security_monitoring_suppression";
let local_client = &self.client;
let local_uri_str = format!(
- "{}/api/v2/siem-historical-detections/jobs",
- local_configuration.get_operation_host(operation_id)
+ "{}/api/v2/security_monitoring/configuration/suppressions/{suppression_id}",
+ local_configuration.get_operation_host(operation_id),
+ suppression_id = datadog::urlencode(suppression_id)
);
let mut local_req_builder =
local_client.request(reqwest::Method::GET, local_uri_str.as_str());
- if let Some(ref local_query_param) = page_size {
- local_req_builder =
- local_req_builder.query(&[("page[size]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = page_number {
- local_req_builder =
- local_req_builder.query(&[("page[number]", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = sort {
- local_req_builder =
- local_req_builder.query(&[("sort", &local_query_param.to_string())]);
- };
- if let Some(ref local_query_param) = filter_query {
- local_req_builder =
- local_req_builder.query(&[("filter[query]", &local_query_param.to_string())]);
- };
-
// build headers
let mut headers = HeaderMap::new();
headers.insert("Accept", HeaderValue::from_static("application/json"));
@@ -5159,9 +5312,10 @@ impl SecurityMonitoringAPI {
log::debug!("response content: {}", local_content);
if !local_status.is_client_error() && !local_status.is_server_error() {
- match serde_json::from_str::(
- &local_content,
- ) {
+ match serde_json::from_str::<
+ crate::datadogV2::model::SecurityMonitoringSuppressionResponse,
+ >(&local_content)
+ {
Ok(e) => {
return Ok(datadog::ResponseContent {
status: local_status,
@@ -5172,7 +5326,7 @@ impl SecurityMonitoringAPI {
Err(e) => return Err(datadog::Error::Serde(e)),
};
} else {
- let local_entity: Option =
+ let local_entity: Option =
serde_json::from_str(&local_content).ok();
let local_error = datadog::ResponseContent {
status: local_status,
@@ -5183,14 +5337,15 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the list of configured security filters with their definitions.
- pub async fn list_security_filters(
+ /// Get the details of a notification rule for security signals.
+ pub async fn get_signal_notification_rule(
&self,
+ id: String,
) -> Result<
- crate::datadogV2::model::SecurityFiltersResponse,
- datadog::Error,
+ crate::datadogV2::model::NotificationRuleResponse,
+ datadog::Error,
> {
- match self.list_security_filters_with_http_info().await {
+ match self.get_signal_notification_rule_with_http_info(id).await {
Ok(response_content) => {
if let Some(e) = response_content.entity {
Ok(e)
@@ -5204,21 +5359,23 @@ impl SecurityMonitoringAPI {
}
}
- /// Get the list of configured security filters with their definitions.
- pub async fn list_security_filters_with_http_info(
+ /// Get the details of a notification rule for security signals.
+ pub async fn get_signal_notification_rule_with_http_info(
&self,
+ id: String,
) -> Result<
- datadog::ResponseContent,
- datadog::Error